views:

120

answers:

1

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:

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

+1  A: 

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

SeanJA
you will have to copy the link into your browser I guess since it didn't all work
SeanJA
thanks, that's a pretty good one, just in time before they closed the question :)
Alex R
Zoom! Under the wire!
SeanJA
On project euler http://projecteuler.net/index.php?section=problems you'll find real but mostly short, meanwhile expensive problems. 2 Problems occur: To see the solutions for a problem you need to solve it yourselft - then you'll normally find php-solutions between the others too. But you would have to ask for usage permission for these to be used inside a benchmark.
user unknown