Tom Molesworth > Protocol-Memcached > benchmark/compare.pl

Download:
Protocol-Memcached-0.004.tar.gz

Annotate this POD

Website

View/Report Bugs
Source  

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

Connect to the socket and enable nonblocking mode.

write

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

Close the socket immediately.

connect

Connects to memcached and hits the on_connected callback if available.

write

Pass data straight over to IO::Async::Stream which already uses the '$data, on_flush => coderef' API.

write

Attempt to write data to the socket using the ->put method as per cookbook examples.

run

Main entry point - will attempt to connect, expecting the {connect} handler to call ->iterate when it's ready.

iterate

Queue the SET + GET for the next pending value, or hit cycle_complete if we're done.

cycle_complete

Mark this benchmark as finished, reporting on stats.

run_loop

Execute the main loop.

next_value

Returns next value if we have one.

syntax highlighting: