Phar performances benchmark

From: Date: Mon, 08 Jun 2009 14:50:02 +0000
Subject: Phar performances benchmark
Groups: php.qa 
Request: Send a blank email to php-qa+get-65074@lists.php.net to get a copy of this message
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). Olivier

« previous php.qa (#65074) next »