From: Lucas Bajolet Date: Thu, 2 Apr 2015 14:24:00 +0000 (-0400) Subject: benchmarks/string: Added README X-Git-Tag: v0.7.4~43^2 X-Git-Url: http://nitlanguage.org?hp=10bd1151af3309010cc56aede18fc28c2975d4d8 benchmarks/string: Added README Signed-off-by: Lucas Bajolet --- 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.