From ee5900065bd9595f041b511618e0270f283e9c23 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 2 Apr 2015 10:24:00 -0400 Subject: [PATCH] benchmarks/string: Added README Signed-off-by: Lucas Bajolet --- benchmarks/strings/README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 benchmarks/strings/README.md diff --git a/benchmarks/strings/README.md b/benchmarks/strings/README.md new file mode 100644 index 0000000..b87b981 --- /dev/null +++ b/benchmarks/strings/README.md @@ -0,0 +1,41 @@ +# Strings + +Strings are a building block of programming. +Since they are that necessary, we must keep them as performing as possible. + +This series of benchmarks works on different structures for handling strings on the most common operations done on them. + +## Structures + +Some more structures are susceptible to be added as the project advances. +At the moment, what is available consists of + +* Flat strings +* Flat buffers +* Rope strings +* Rope buffers + +A String is defined as an immutable string. +A Buffer is defined as a mutable string. + +Flat strings are arrays of characters, the most basic implementation of a string. +Ropes are a tree-like structure where strings are bound through concatenation nodes. + +## Tests + +`concat`: Benches the concatenation speed of strings and buffers. + +`iter`: Benches the time of iteration of a string, through iterators or indexed access + +`substr`: Benches the time required to produce a substring. + +`arraytos`: Special bench, it measures the speed of `Array::to_s` through the use of various strategies. + +## Usage + +To pass a series of benches you can use the `make` command to bench all the aforementioned tests with default values. + +Each bench will be executed 5 times and the mean time will be represented in the final graph. + +The alternative is to use `bench_strings.sh` with custom arguments to it. +For more information on the arguments and the format, execute it with the -h option for help. -- 1.7.9.5