Sunday, April 15, 2012

Experimenting with precompiled regexes in Unquote

Today I spent some time experimenting with precompiled regexes in Unquote: https://unquote.googlecode.com/svn/branches/precompiled-regex. However, I was not able to show any measurable performance improvements from this work. Perhaps this was to be expected, considering Unquote only uses 5 compiled regexes currently and the upfront cost of compiling those on the fly must be small compared to the actual regex matching performed across all of Unquote’s nearly 500 unit tests (though Unquote uses a relatively small number of regexes, they are used frequently). So, for now, we’ll stick with normal compiled-on-the-fly regexes, unless we gain a large number of regexes in the future. But, it is worth noting the compiling on-the-fly does increase the performance of Unquote by 2x.

No comments:

Post a Comment