{"action":"created","issue":{"url":"https://api.github.com/repos/slevithan/xregexp/issues/79","labels_url":"https://api.github.com/repos/slevithan/xregexp/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/slevithan/xregexp/issues/79/comments","events_url":"https://api.github.com/repos/slevithan/xregexp/issues/79/events","html_url":"https://github.com/slevithan/xregexp/issues/79","id":46590842,"number":79,"title":"The performance is awful.","user":{"login":"steffenw","id":101567,"avatar_url":"https://avatars.githubusercontent.com/u/101567?v=3","gravatar_id":"","url":"https://api.github.com/users/steffenw","html_url":"https://github.com/steffenw","followers_url":"https://api.github.com/users/steffenw/followers","following_url":"https://api.github.com/users/steffenw/following{/other_user}","gists_url":"https://api.github.com/users/steffenw/gists{/gist_id}","starred_url":"https://api.github.com/users/steffenw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steffenw/subscriptions","organizations_url":"https://api.github.com/users/steffenw/orgs","repos_url":"https://api.github.com/users/steffenw/repos","events_url":"https://api.github.com/users/steffenw/events{/privacy}","received_events_url":"https://api.github.com/users/steffenw/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-10-23T05:41:48Z","updated_at":"2015-06-04T05:14:21Z","closed_at":"2015-06-04T05:14:21Z","body":"I tested that package but the performance during compiling the regex to a real JavaScript regex was awful. The website need lots of time for 1 time run of that regex. Chrome needs about 30 seconds. Now with the real JavaScript regex the run was shorter than a click. So I removed xregexp a quick as possible.\r\n\r\nThe idea is good because I know very good readable regexes only from Perl. That was the reason to try that.\r\n\r\nThe regex I wrote was:\r\n```\r\nvar keyRegexPart\r\n    = jQuery.map(\r\n        Object.keys(replaceMap),\r\n        function (key, index) {\r\n            return XRegExp.escape(key);\r\n        }\r\n    )\r\n    .join('|');\r\nvar placeholderRegex = XRegExp(\r\n    '(?<placeholder>                            # full match \\n\\\r\n        \\\\{                                     # {          \\n\\\r\n            (?<name>                            # name       \\n'\r\n    + keyRegexPart\r\n    +       ')                                               \\n\\\r\n            (?: [ ]* [:] (?<attr> [^:\\\\}]+ ) )? # :attr_name \\n\\\r\n        \\\\}                                     # }          \\n\\\r\n    )',\r\n    'xmsg'\r\n);\r\n```"},"comment":{"url":"https://api.github.com/repos/slevithan/xregexp/issues/comments/108728412","html_url":"https://github.com/slevithan/xregexp/issues/79#issuecomment-108728412","issue_url":"https://api.github.com/repos/slevithan/xregexp/issues/79","id":108728412,"user":{"login":"slevithan","id":1466797,"avatar_url":"https://avatars.githubusercontent.com/u/1466797?v=3","gravatar_id":"","url":"https://api.github.com/users/slevithan","html_url":"https://github.com/slevithan","followers_url":"https://api.github.com/users/slevithan/followers","following_url":"https://api.github.com/users/slevithan/following{/other_user}","gists_url":"https://api.github.com/users/slevithan/gists{/gist_id}","starred_url":"https://api.github.com/users/slevithan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slevithan/subscriptions","organizations_url":"https://api.github.com/users/slevithan/orgs","repos_url":"https://api.github.com/users/slevithan/repos","events_url":"https://api.github.com/users/slevithan/events{/privacy}","received_events_url":"https://api.github.com/users/slevithan/received_events","type":"User","site_admin":false},"created_at":"2015-06-04T05:14:21Z","updated_at":"2015-06-04T05:14:21Z","body":"Closing since @steffenw hasn't confirmed the version and I can't repro. The provided regex compiles near instantly (although I don't know what string was held by the `keyRegexPart` variable, and if this was a very long string it would take longer on the first compilation). The compiled regex will then run as fast as a native regex (since it is compiled to a native regex)."}}