Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a PHP benchmark that meets these specific criteria? [closed]

The actual question at the bottom... first some background info:

I'm working on a tool which converts PHP code to Scala. As one of the finishing touches, I'm in need of a really good (er, somewhat biased) benchmark.

By dumb luck my first benchmark attempt was with some code which uses bcmath extensively, which unfortunately is 1000x slower in Java, making the Scala code 22x slower overall than the original PHP.

So I'm looking for some meaningful PHP benchmark with the following characteristics:

  • The PHP source needs to be in a single file.
  • It should solve a real-world or scientific problem. No silly looping over empty methods etc.
  • I need it to be simple to setup - no databases, hard-to-find input files, etc.
  • It needs to be single-threaded (unfortunately most benchmarks in the CLBG are now multi-threaded)
  • Simple text input and output preferred.
  • It should not use features that are slow in Java (BigInteger, trigonometric functions, etc).
  • It should not use exoteric or dynamic PHP functions (e.g. no "eval" or "variable vars").
  • It should not over-rely on built-in libraries, e.g. MD5, crypt, etc - because I want to benchmark the quality of the PHP-to-Scala conversion, not the quality of the library implementation.
  • It should not be I/O bound. A CPU-bound memory-hungry algorithm is preferred.
  • Basically, intensive OO operations, integer and string manipulation, recursion, etc would be great.

I have already checked two popular sources, but there is nothing there that meets the criteria:

  • CLBG: http://shootout.alioth.debian.org/ - everything is multi-threaded - no good.
  • PHP Bench: http://www.phpbench.com/ - micro-benchmarks, no real-world - no good
  • PHP.NET RFC: Better Benchmarks: http://wiki.php.net/rfc/better_benchmarks - some good info here, but ultimately nothing found.

So, without further ado, the actual question:

Is there an existing open-source body of code that meets the above criteria as a performance benchmark?

Thanks

like image 572
Alex R Avatar asked Apr 24 '10 01:04

Alex R


1 Answers

You could always check for some bigish php files in google code search or github (you can actually search github by filesize which might help).

I have found that pdf classes are usually quite big and monolithic

http://www.google.com/codesearch/p?hl=en#RoURSOxSogQ/trunk/dotproject/lib/ezpdf/class.pdf.php&q=lang:php%20file:.pdf&sa=N&cd=1&ct=rc

like image 74
SeanJA Avatar answered Oct 02 '22 19:10

SeanJA