https://github.com/staabm/php-phardata-benchmark
Repro Script for PHP-SRC Bug #80399
https://github.com/staabm/php-phardata-benchmark
Last synced: about 1 year ago
JSON representation
Repro Script for PHP-SRC Bug #80399
- Host: GitHub
- URL: https://github.com/staabm/php-phardata-benchmark
- Owner: staabm
- Created: 2020-11-22T11:19:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-23T12:31:28.000Z (over 5 years ago)
- Last Synced: 2025-03-05T11:39:12.080Z (over 1 year ago)
- Language: PHP
- Homepage: https://bugs.php.net/bug.php?id=80399
- Size: 1.71 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This repo contains [a repro-benchmark](https://github.com/staabm/php-phardata-benchmark/blob/master/bench.php) to show how slow PharData is compared to a simple userland library.
we see PharData beeing roughly 10x slower then the userland library [splitbrain/php-archive](https://github.com/splitbrain/php-archive).
## profilled using blackfire
```bash
blackfire run php bench.php
Start using PharData
duration: 0.68688011169434
Start using splitbrain/php-archive
duration: 0.25864601135254
Memory 1.22MB
Wall Time 992ms
I/O Wait 581ms
CPU Time 412ms
Network n/a n/a n/a
SQL n/a n/a
```

## See the following testruns on my windows10 x64 notebook:
```bash
$ php -v
PHP 7.3.0 (cli) (built: Dec 6 2018 02:17:00) ( ZTS MSVC15 (Visual C++ 2017) x86 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
with blackfire v1.24.1~win-x32-zts73, https://blackfire.io, by Blackfire
$ php bench.php
Start using PharData
duration: 1.5862009525299
Start using splitbrain/php-archive
duration: 0.076961040496826
$ php bench.php
Start using PharData
duration: 1.0293560028076
Start using splitbrain/php-archive
duration: 0.083132982254028
$ php bench.php
Start using PharData
duration: 0.99211502075195
Start using splitbrain/php-archive
duration: 0.096863985061646
$ php bench.php
Start using PharData
duration: 1.0401749610901
Start using splitbrain/php-archive
duration: 0.088247776031494
```
the same is true when GZIP is activated.
## Results on MacBook Pro with macOS 11.0.1:
```bash
$ php -v
PHP 7.4.12 (cli) (built: Oct 29 2020 18:37:21) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.12, Copyright (c), by Zend Technologies
with blackfire v1.44.0~mac-x64-non_zts74, https://blackfire.io, by Blackfire
$ php bench.php
Start using PharData
duration: 0.23402190208435
Start using splitbrain/php-archive
duration: 0.036140918731689
$ php bench.php
Start using PharData
duration: 0.30424404144287
Start using splitbrain/php-archive
duration: 0.024400949478149
$ php bench.php
Start using PharData
duration: 0.30759882926941
Start using splitbrain/php-archive
duration: 0.024186849594116
$ php bench.php
Start using PharData
duration: 0.28332209587097
Start using splitbrain/php-archive
duration: 0.022264003753662
```
## tested on ubuntu20
```bash
$ php -v
PHP 7.4.12 (cli) (built: Oct 31 2020 17:04:25) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.12, Copyright (c), by Zend Technologies
with Xdebug v2.9.8, Copyright (c) 2002-2020, by Derick Rethans
with blackfire v1.44.0~linux-x64-non_zts74, https://blackfire.io, by Blackfire
$ php bench.php
Start using PharData
duration: 0.68476390838623
Start using splitbrain/php-archive
duration: 0.048066854476929
$ php bench.php
Start using PharData
duration: 0.68217706680298
Start using splitbrain/php-archive
duration: 0.045325040817261
```
## tested on ubuntu18
```bash
php -v
PHP 7.2.34-2+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Oct 10 2020 19:44:20) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.34-2+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.9.8, Copyright (c) 2002-2020, by Derick Rethans
with blackfire v1.44.0~linux-x64-non_zts72, https://blackfire.io, by Blackfire
k$ php bench.php
Start using PharData
duration: 0.7270200252533
Start using splitbrain/php-archive
duration: 0.055887937545776
$ php bench.php
Start using PharData
duration: 0.69905304908752
Start using splitbrain/php-archive
duration: 0.054063081741333
$ php bench.php
Start using PharData
duration: 0.64250612258911
Start using splitbrain/php-archive
```