Neil's News

Moore's Bet 2

16 July 2012

In June 2009 I made a bet with my friend Tancred that over the next 15 years I could improve the performance of my diff library by a factor of 1000. That means doubling performance every 18 months. The first 18 months resulted in significant improvements in the algorithm's speed. It has been another 18 months, so let's see how we've done in the second iteration.

Below is a graph of diff speeds for each language, with tests run on the 16 December 2010 codebase (blue) and the 6 January 2012 codebase (orange). All languages boast impressive speed improvements due to algorithm upgrades, with the exception of Lua and Python which actually took a slightly backward step. It is important to note that both sets of tests were run on the same hardware/software stack, so the actual speed increase is even more significant when one factors in processor upgrades, smarter compilers and better browsers.

[Graph of speed difference]

Small print: C# was compiled with Mono. Java was version 1.6. PyPy 1.9 and Python 3.2 were running the same code, despite the massive speed difference. Chrome 20, Safari 5, Firefox 13 and Opera 12 are all the latest browser versions. Lua was version 5.2. Dart is not shown since the language is only a technology preview at this time. C++ does not currently have a speed testing harness, so there's no data. All tests were run on the same MacBook Pro on the same day, so Moore's Law is not reflected in this data.

This is the first time that I've had a slight regression. In order to keep the DMP library vaguely maintainable in all its language ports, I'm extremely strict in enforcing equality across all versions. Thus I am not prepared to fork the Lua and Python versions to chase higher performances in those language. Besides, if one is using Lua or Python, it's clear that speed is not one's primary consideration.

Cumulatively in the first two iterations of this bet, the C# implementation has improved by a factor of 162, and the Java implementation has improved by a factor of 154. Times whatever processor and compiler improvements we've had in that time. I'm still on track for Tancred's pizza. Check back for the next update in December 2013.

< Previous | Next >

Legal yada yada: My views do not necessarily represent those of my employer or my goldfish.