JsonPath-PHP is a PHP extension that makes it easy to work with data arrays using the JSONPath notation. Here we compare the performance of the JSONPath-PHP extension against similar types of libraries in PHP as well as the equivalent data lookups written in native PHP code.
- Native PHP (considered as the baseline for comparison)
- JsonPath-PHP extension [GitHub]
- JSONPath for PHP library by SoftCreatR [GitHub] [Packagist]
- JsonPath library by Galbar [GitHub] [Packagist]
- Tiny dataset (1 row, filesize < 1kB)
- Medium dataset (3 532 rows, filesize 1.2MB)
- Huge dataset (72 733 rows, filesize 63MB)
The datasets are built from datasets provided by the Tate Collection.
To run the benchmark tests:
- Clone the repository.
- Run
composer install
to install the dependencies. - Run
./vendor/bin/phpbench run --report=overview
to perform the benchmarks.
The benchmark tests can take a minute or two to run, depending on your setup.
MIT.