ArangoDB-PHP Driver Improvements
source link: http://jsteemann.github.io/blog/2015/09/10/arangodb-php-driver-improvements/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
ArangoDB-PHP Driver Improvements
Sep 10th, 2015
While preparing the release of ArangoDB 2.7, some improvements were made for the PHP driver for ArangoDB.
The 2.7 version of the PHP driver now supports the AQL query results cache. The cache can be turned on or off globally, or be set to demand mode. The demand mode will allow controlling caching on a per-AQL-query basis.
Additionally, the HTTP transport layer in the PHP driver was improved. Some internal string handling methods were optimized so that the transport part becomes cheaper. All driver operations that communicate with the ArangoDB server will benefit from this.
For a demonstration of the improvements, here is a script that creates 100,000
documents in a local ArangoDB database via the PHP driver. As we’re interested in assessing
the HTTP layer improvements, the script intentionally issues 100,000 HTTP requests
instead of using the specialized import
method provided by the driver.
The script code can be found here.
The baseline for the improvments is the (non-optimized) 2.6 version of the PHP driver. Here are the results for issuing 100,000 requests with the 2.6 driver (script was run twice to see if there are variations in execution time):
execution times with 2.6 driver
|
Running it with the 2.7 version of the PHP driver now shows the improvements. Execution time for the same script goes down from 54 seconds to 42 seconds:
execution times with 2.7 driver
|
The PHP version used here was:
PHP version details
|
Following are the results from a different machine, this time using PHP 5.6:
execution times with 2.6 driver
|
|
The PHP version details for this machine were:
PHP version details
|
The actual improvements depend on many factors, so your exact mileage may vary. The improvements may not be noticable for applications that issue only a few requests with the driver, but they will be significant when performing lots of requests, as in the above examples.
Posted by jsteemann
Sep 10th, 2015ArangoDB, PHP, Performance
« On building AQL query strings C++ constructors and memory leaks »
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK