Writing a regex-based sudoku solver with very little language-dependent code opened the door to benchmarking the various PCRE engines. Without much work, I was able to test perl, ruby, python and python-psyco.
Here are the results, unit is seconds:
sudre.pl sudre.rb sudre.py sudre.psyco empty.input 0.012 0.028 0.316 0.240 full.input 0.032 0.076 0.312 0.264 level-1.input1 0.028 0.072 0.328 0.268 level-1.input2 0.028 0.068 0.328 0.268 level-1.input3 0.024 0.052 0.328 0.248 level-1.input4 0.008 0.020 0.316 0.240 level-1.input5 0.008 0.016 0.308 0.236 level-2.input1 0.012 0.016 0.320 0.228 level-2.input2 0.112 0.300 0.400 0.356 level-2.input3 0.172 0.464 0.440 0.412 level-2.input4 0.016 0.048 0.316 0.252 level-2.input5 0.064 0.184 0.340 0.288 level-3.input1 0.212 0.552 0.484 0.424 level-3.input2 0.028 0.072 0.336 0.244 level-3.input3 1.404 3.564 1.428 1.492 level-3.input4 0.072 0.172 0.360 0.296 level-3.input5 3.676 8.725 3.044 3.332 level-4.input1 0.612 1.504 0.840 0.776 level-4.input2 1.580 4.036 1.604 1.736 level-4.input3 0.076 0.220 0.332 0.316 level-4.input4 0.052 0.140 0.352 0.284 level-4.input5 0.076 0.196 0.368 0.292 ----- ----- ----- ----- mean 0.377 0.933 0.600 0.568
Some quick observations: