Performance

I created the code to calculate Texas Hold’em pre-flop probabilities in the different languages (c, java, perl, php and VB.net) to compare the performance of those languages for a compute intensive algorithm (and for the enjoyment of it, sick mind).

I did the development on two machines. The first is an old PC (Pentium 4 2.4 Ghz) that I installed ubuntu on. ubuntu was good to develop everything but VB.net which required a Windows machine. For the Windows machine I used an old Vista machine (yes I’m the guy still running Vista!). In order to compare VB.net to the other languages I installed cygwin so I could compare to c and perl. Not a perfect way to do it but it allows me to infer what the relative performance is.

The table below gives the number of seconds required to calculate hand probabilities for a 10-handed game running the simulation for one million hands.

As with many studies the results were not what I expected going in. I expected c performance to be the best, which it was for the most part though java performance was just as fast. Never expected that. And I would have never guessed that php and perl would be so slow compared to the others. I expected VB.net to be close to java in performance and while it was not slow, java blew its’ doors off, something I did not expect.