Archive for March, 2012

Mar
22

Regex Performance in D Programming Language

Note: The problem described in this post was for DMD v2.054 and it no longer occurs with the more recent DMD v2.058  (see below for details or view the discussion at the D Forums).

I am currently working on a Ruby project that uses a lot of regexes on large volumes of text.  It is currently running too slowly, so I decided to try to optimise it by implementing the regex matching code in the D programming language.  D has given me a lot of joy (compared to C or C++)  by making things like string (with Unicode) handling a breeze without taking the performance hit of supposed “productivity” languages.  I painstakingly reimplemented my Ruby functions in D expecting a huge performance boost (actually I expected an order of magnitude performance jump) but instead I was shocked to see that Ruby outperformed my D code by a significant margin.  The Ruby implementation was finished after 80 seconds, whereas the D program required around 280 seconds using the exact same regexes and the exact same input.

(more…)

Mar
18

The Renaissance of Indy Gaming

space_invader

In the olden days you could pick up a tape cassette containing a Spectrum or Amstrad game for a few pounds (yes, I’m British).  At this time, the gaming industry was in its infancy and the business side of the game was highly underdeveloped.  Games were written by a single (or a very small group) in squalid conditions and these programmers were like rock stars, or mad scientists working alone in their lab (complete with the associated lightning and electrical apparatus).  Some games turned out to be “smash hits” (Monty Mole, Manic Miner, Dynamite Dan to name a few), others were of very poor quality but hey, that’s the price you pay for experimenting.  How things have changed!

(more…)