Conway's Game of Life

A classic artificial petri dish in DHTML

Step time (ms): < >


Instructions:

What's going on?

This version of the Game of Life is slower and smaller than most you can find on the Web, because it runs natively in your browser, without any plugins. The Game of Life is ideally played out on an infinitely large field; in practice, the field is expanded as needed to allow the patterns plenty of room to grow. If you want to really appreciate the amazing diversity of patterns found in the full-size Game of Life, I recommend here or here.

Technical note: I wrote this 31-bit implementation of the Game of Life to test the limits of browser performance. It uses a relatively fast bitwise algorithm to munch entire rows in one go, rather than the standard two-dimensional array implementation. The script keeps the DIV cells cached in an array, to minimize DOM calls. The main performance barrier here is the browser's DOM access time, as the script updates only changed cells, toggling the CSS background-color attribute.

It turns out that Safari, Firefox and Opera are extremely fast and run fine down to 10ms step time on most machines, while Internet Explorer 6 is unbearably sluggish below about 80ms step time. Internet Explorer 7 shows some significant performance gains over IE6, but fails to live up to the benchmark set by modern browsers.

Formal benchmarks using this test are forthcoming.