じっけん結果。
RegExpのコンパイルは、あまり効果がなかったみたい。

Benchmark: timing 5 iterations of a, b, c...
a: 46 wallclock secs (42.39 usr + 0.01 sys = 42.40 CPU) @ 0.12/s (n=5)
b: 43 wallclock secs (25.86 usr + 0.03 sys = 25.89 CPU) @ 0.19/s (n=5)
c: 28 wallclock secs (26.54 usr + 0.02 sys = 26.56 CPU) @ 0.19/s (n=5)
s/iter a c b
a 8.48 -- -37% -39%
c 5.31 60% -- -3%
b 5.18 64% 3% --