basho / riak-php-client

PHP clients for Riak
Apache License 2.0
160 stars 69 forks source link

Rewrite for Riak 2.0 feature support #95

Closed christophermancini closed 9 years ago

christophermancini commented 9 years ago

We have completely rewritten the library from the ground up with a focus on simplicity of the developer API and portability by having its only dependency be the PHP cURL extension. The rewrite is currently only compatible with Riak's HTTP interface.

Using a simple benchmarking tool, we have identified an increase in write operations per second of over 10% and a decrease in fetches of 2.5% compared to the old codebase of this library. The output is below but please note that actual performance for you may vary based on MANY variables. This benchmarks were run using PHP v5.4.39 with Xdebug disabled.

[vagrant@localhost riak-clients-performance-comparison]$ ./vendor/bin/athletic -p src/RiakClientPerformanceComparison

RiakClientPerformanceComparison\FetchObjectEvent
    Method Name                 Iterations    Average Time      Ops/second
    -------------------------  ------------  --------------    -------------
    fetchUsingBashoRiakHttp  : [10,000    ] [0.0025948997021] [385.37135]
    fetchUsingBashoRiak2Http : [10,000    ] [0.0026617594481] [375.69135]

RiakClientPerformanceComparison\StoreObjectEvent
    Method Name                 Iterations    Average Time      Ops/second
    -------------------------  ------------  --------------    -------------
    storeUsingBashoRiakHttp  : [10,000    ] [0.0045337545395] [220.56774]
    storeUsingBashoRiak2Http : [10,000    ] [0.0040378854275] [247.65438]
hazen commented 9 years ago

Tests seem to pass:

PHPUnit 4.5.1 by Sebastian Bergmann and contributors.

Configuration read from /Users/hazen/dev/clients/php/mancini/phpunit.xml

...............................................................  63 / 125 ( 50%)
..............................................................

Time: 20.08 seconds, Memory: 9.50Mb

OK (125 tests, 1357 assertions)```
alexmoore commented 9 years ago

Tests pass for me on PHP 5.6 on OS X 10.10.