GNOME Bugzilla – Bug 560234
Make a regex static to improve performance
Last modified: 2009-01-21 20:28:58 UTC
I stumbled upon this by chance : the regex in Hyena.StringUtil.CamelCaseToUnderCase is re-created for each call. I'll attach a patch to make the regex static Here the relevant "mono --profile" output before the patch : Time(ms) Count P/call(ms) Method name ######################## 1628.804 146 11.156 System.Text.RegularExpressions.Regex::Split(string,string) Callers (with count) that contribute at least for 1%: 146 100 % Hyena.StringUtil::CamelCaseToUnderCase(string,char) After the patch : ######################## 279.055 144 1.938 System.Text.RegularExpressions.Regex::Split(string) Callers (with count) that contribute at least for 1%: 144 100 % Hyena.StringUtil::CamelCaseToUnderCase(string,char)
Created attachment 122354 [details] [review] Make the regex a static field
Assuming this works for you, Bertrand, feel free to commit post 1.4.2.
Whoops, that comment was for a different bug, but it's fine for this one too :)
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.