{"id":621,"date":"2011-11-08T11:25:32","date_gmt":"2011-11-08T09:25:32","guid":{"rendered":"http:\/\/hen.co.za\/blog\/?p=621"},"modified":"2011-11-10T14:14:08","modified_gmt":"2011-11-10T12:14:08","slug":"regexoptions-compiled-and-x64-are-not-friends","status":"publish","type":"post","link":"https:\/\/hen.co.za\/blog\/2011\/11\/regexoptions-compiled-and-x64-are-not-friends\/","title":{"rendered":"RegexOptions.Compiled and x64 are not friends"},"content":{"rendered":"<p>As part of my attempt to use the <a title=\"FastColoredTextBox\" href=\"http:\/\/www.codeproject.com\/KB\/edit\/FastColoredTextBox_.aspx\" target=\"_blank\">FastColoredTextBox<\/a> control I stumble across one of those undocumented .Net bugs that has been laying around for some time without being fixed &#8211; The Regex class with\u00a0RegexOptions.Compiled option compiled under x64 or (Any CPU) that executes extremely slowly. In fact, it performs so slowly that it appears the whole application is frozen for a few minutes while the memory usage slowly climbs to ridiculous levels.<\/p>\n<p>There are only 2 solutions to this issue for now: (1) compile all assemblies with x86 option only (not great if you are running on 64-bit) or (2) do not use the RegexOptions.Compiled option. For me the latter is a better choice since there is hardly a different between compiled and not compiled regular expression processing times &#8211; that I can see and certainly better than waiting minutes for a frozen app to start reacting again.<\/p>\n<p>Thanks Microsoft for this one. Great way to waste time trying to look for problems in you own app while it is their crap breaking stuff.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of my attempt to use the FastColoredTextBox control I stumble across one of those undocumented .Net bugs that has been laying around for some time without being fixed &#8211; The Regex class with\u00a0RegexOptions.Compiled option compiled under x64 or &hellip;<\/p>\n<p class=\"read-more\"><a href=\"https:\/\/hen.co.za\/blog\/2011\/11\/regexoptions-compiled-and-x64-are-not-friends\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,16],"tags":[7,104,8,9,303,29],"class_list":["post-621","post","type-post","status-publish","format-standard","hentry","category-development","category-reference","tag-net","tag-bug","tag-c","tag-code","tag-development","tag-problem"],"_links":{"self":[{"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/posts\/621","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/comments?post=621"}],"version-history":[{"count":2,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/posts\/621\/revisions"}],"predecessor-version":[{"id":628,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/posts\/621\/revisions\/628"}],"wp:attachment":[{"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/media?parent=621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/categories?post=621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/tags?post=621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}