Conway's Game of Life implementation in various languages

Language: PHP

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
1st. Javascript 0.00511s 0.00334s SpiderMonkey 31 (Firefox 33)
2nd. Javascript 0.00670s 0.00230s 131.1% (1.31x) V8 (Chrome 38.0.2125.104)
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

Project Statistics

Sourcerank 3
Repository Size 337 KB
Stars 7
Forks 1
Watchers 1
Open issues 4
Dependencies 0
Contributors 2
Tags 0
Last updated
Last pushed

Top Contributors See all

Kieran Pilkington Troy Thompson

Something wrong with this page? Make a suggestion

Last synced: 2017-04-04 14:51:10 UTC

Login to resync this repository