The goal is to provide near identical implementations of Conway’s Game of Life in multiple languages to measure not only the speed of the language, but for each person to assess the syntax of each, and the ease and availability of unit testing tools.
I started with the Ruby implementation, optimized it as much as I could, and then ported it to the other languages. Therefore, some languages may not be running as fast as they possibly could. Any suggestions for optimizations are greatly appreciated.
Note 1: These speed results are taken on a Late 2008 Macbook, 2.4 GHz Intel Core 2 Duo, with 2 GB of 667 MHz DDR2 SDRAM.
Note 2: The times were calculated by averaging the times from ticks 2 through 11 (tick 1 is ignored because of cache warm up).
| Place | Language | Tick Time | Render Time | % slower than 1st place | Notes |
|---|---|---|---|---|---|
| 1st. | Javascript | 0.011s | 0.003s | V8 3.6.6.8 | |
| 2nd. | Javascript | 0.019s | 0.005s | 71.4% | Firefox 8.0 |
| 3rd. | Ruby | 0.017s | 0.015s | 128.5% | Ruby 1.9.3p0 |
| 4th. | Ruby | 0.023s | 0.019s | 200.0% | Ruby 1.9.2p290 |
| 5th. | PHP | 0.085s | 0.023s | 671.4% | PHP 5.3.6 |