Re: Phar performances benchmark
| From: | Greg Beaver | Date: | Tue, 09 Jun 2009 02:59:38 +0000 |
| Subject: | Re: Phar performances benchmark | ||
| References: | 1 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-65076@lists.php.net to get a copy of this message | ||
Olivier Doucet wrote:
> Hello everyone,
>
> I was testing phar performances, and I decided to share my results with you.
> I'm not sure QA is the best mailing list for it, but maybe these results
> could be connected to the phpbench project ?
>
> I used phpmyadmin project to test phar archives. Folder is
> "phpMyAdmin-3.1.5-all-languages", with 661 files in 35 folders for a total
> size of 11 232 453 bytes.
> I used PHP 5.3.0-RC2 as cli.
>
> Creation of archives:
> - BZ2 compression with SHA1 signature 4.9 sec 2,863,812 bytes
> - BZ2 compression with MD5 signature 5.2 sec 2,863,759 bytes
> - GZ compression with SHA1 signature 3.3 sec 3,608,594 bytes
> - GZ compression with MD5 signature 3.6 sec 3,608,598 bytes
> - not compressed with SHA1 signature 1.3 sec 11,277,397 bytes
> - not compressed with MD5 signature 1.9 sec 11,277,392 bytes
>
> => Results changed slightly when launching again the bench. Perfs between
> signatures should be seen as equals.
>
>
> Reads (200.000 loops) : (consists of two file_get_contents)
> Base result: reading directly in folder:
> phpMyAdmin-3.1.5-all-languages: 12.1 sec
>
> Now use "phar://" as path:
> plain_md5: 17.0 sec
> plain_sha1: 16.7 sec
> gz_md5: 16.4 sec
> gz_sha1: 17.1 sec
> bz2_md5: 17.9 sec
> bz2_sha1: 19.2 sec
>
> As you can see, performances are very good in gzip format (no difference
> with direct read) ; bz2 is slower, but I was expecting worst results.
>
>
> Scripts are available on demand (they are not "clean", that's why I didn't
> published it here directly).
Hi Olivier,
This is great to see. Also useful would be a direct comparison of the
phar format with tar-based and zip-based phars with each compression
possible, as well as a comparison against reading the files off-disk
with PHP. It might also be interesting to compare using phar to create
an archive with buildFromDirectory() against the tar/zip commands
directly, or against ext/zip.
Even more interesting to users (I think) is a comparison of running
phpMyAdmin directly against running it out of a phar archive with the
various formats, as well as running it with phar.cache_list set to the
full path to the archive.
Thanks,
Greg