Multi-language implementations of Conway’s Game of Life
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, optimised 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 optimisations that can be translated to each implementation are greatly appreciated (minimal language specific optimisations please).
Speed Results (by tick time)
Note 1: These speed results are taken on a 13", Late 2011 Macbook Pro, 2.8 GHz Intel Core i7, with 4 GB of 1333 MHz DDR3 RAM.
Note 2: The times were calculated by playing each simulation for a few thousand ticks until the game stopped moving and the average stabilised.
|Place||Language||Tick Time||Render Time||% slower||Notes|
|3rd.||Ruby||0.00770s||0.00730s||150.6% (1.50x)||Ruby 2.1.2|
|4th.||PHP||0.02718s||0.00918s||531.8% (5.31x)||PHP 5.4.30|