diff --git a/README.md b/README.md index 6b66942..29e240e 100644 --- a/README.md +++ b/README.md @@ -30,20 +30,22 @@ asynchronous API of hiredis, even for synchronous commands. There is no dependen Boost or any other libraries. ## Benchmarks -Benchmarks are given by averaging the results of five trials of the speed tests -in `examples/` on an AWS t2.medium instance running Ubuntu 14.04 (64-bit). +Benchmarks are given by averaging the results of ten trials of the speed tests +in `examples/` on an AWS t2.medium instance running Ubuntu 14.04 (64-bit) and a +local Redis server. -Local Redis server, TCP connection: + * `speed_test_async_multi` over TCP: **879,589 commands/s** + * `speed_test_async_multi` over Unix socket: **901,683 commands/s** + * `speed_test_async` over TCP: **203,285 commands/s** + * `speed_test_async` over Unix socket: **301,823 commands/s** + * `speed_test_sync` over TCP: **21,072 commands/s** + * `speed_test_sync` over TCP: **24,911 commands/s** - * 100 command loops (`speed_test_async_multi`): **685,249 commands/s** - * One command loop (`speed_test_async`): **195,439 commands/s** - * Looped synchronous command (`speed_test_sync`): **23,012 commands/s** - -Results are comparable to that of an average laptop. On a high-end machine, -`speed_test_async_multi` usually tops 1,000,000 commands/s. +Results are comparable to that of a mid-range laptop. On a high-end machine, performance +can be much higher. ## Tutorial -This section introduces the main features of redox. Look in the `examples/` for more inspiration. +This section introduces the main features of redox. Look in `examples/` for more inspiration. #### Hello world Here is the simplest possible redox program: @@ -173,7 +175,7 @@ representation of the command (`GET hello` in this case). We often want to run commands on regular invervals. Redox provides the `commandLoop` method to accomplish this. It is easier to use and more efficient than running individual commands in a loop, because it only creates a single Command object. -`commandLoop` takes a command string, a callback, and an interval (in seconds) +`commandLoop` takes a command vector, a callback, and an interval (in seconds) to repeat the command. It then runs the command on the given interval until the user calls `c.free()`. diff --git a/include/redox/client.hpp b/include/redox/client.hpp index 175f9be..e242eed 100644 --- a/include/redox/client.hpp +++ b/include/redox/client.hpp @@ -184,13 +184,13 @@ public: * Given a vector of strings, returns a string of the concatenated elements, separated * by the delimiter. Useful for printing out a command string from a vector. */ - std::string vecToStr(const std::vector& vec, const char delimiter = ' '); + static std::string vecToStr(const std::vector& vec, const char delimiter = ' '); /** * Given a command string, returns a vector of strings by splitting the input by * the delimiter. Useful for turning a string input into a command. */ - std::vector strToVec(const std::string& s, const char delimiter = ' '); + static std::vector strToVec(const std::string& s, const char delimiter = ' '); // ------------------------------------------------ // Command wrapper methods for convenience only