2015-11-07
Monq.jfa even faster with StringBuilder
As mentioned in the previous article, my
revived DFA class library for Java dates
back from the time of Java 1.4. It always made heavy use of
StringBuffer
. Now I found the time to complete
replace all instances of StringBuffer
with
StringBuilder
and rerun the performance test reported
in the previous article. Here is the table again with the new
data:
(all times in seconds)
no. words | 3 | 4 | 11 | 17 | 26 | 35 |
---|---|---|---|---|---|---|
$\Delta t$ regex | 9 | 12 | 28 | 42 | 68 | 82 |
$\Delta t$ monq | 40 | 47 | 49 | 54 | 55 | 56 |
$\Delta t$ monq with StringBuilder |
24 | 24 | 26 | 27 | 29 | 30 |
Now the break even, where monq
takes over
java.util.regex
, is already at around 11 words. But I
am looking already at some profiling results to see if this can be
improved even more.