Get/set benchmark for pure-perl memcached implementation using several backends.
Initial results:
IO::Async::Loop::Poll : 1897.96 cycles/s, 2.635 elapsed POE : 2169.03 cycles/s, 2.306 elapsed IO::Async::Loop::Select: 2446.31 cycles/s, 2.044 elapsed IO::Async::Loop::Epoll : 2684.97 cycles/s, 1.863 elapsed Socket : 7275.04 cycles/s, 0.687 elapsed
Connect to the socket and enable nonblocking mode.
Write data to socket immediately, without checking whether it's able to receive. We'll call on_flush as soon as the write returns.
Close the socket immediately.
Connects to memcached and hits the on_connected callback if available.
Pass data straight over to IO::Async::Stream which already uses the '$data, on_flush => coderef' API.
Attempt to write data to the socket using the ->put method as per cookbook examples.
Main entry point - will attempt to connect, expecting the {connect} handler to call ->iterate when it's ready.
Queue the SET + GET for the next pending value, or hit cycle_complete if we're done.
Mark this benchmark as finished, reporting on stats.
Execute the main loop.
Returns next value if we have one.
To install Protocol::Memcached, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Protocol::Memcached
CPAN shell
perl -MCPAN -e shell install Protocol::Memcached
For more information on module installation, please visit the detailed CPAN module installation guide.