Bug 14504 – Regex Optimizer doesn't merge equivalent threads.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2015-04-26T14:30:00Z
Last change time
2016-04-11T21:06:47Z
Assigned to
dmitry.olsh
Creator
reaperunreal

Comments

Comment #0 by reaperunreal — 2015-04-26T14:30:41Z
Given the following code: import std.stdio, std.regex; void main(string argv[]) { string m = argv[1]; auto p = ctRegex!("a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); if (match(m, p)) { writeln("match"); } else { writeln("no match"); } } Compile time becomes extremely long due to the regex optimizer not merging equivalent threads as explained in the forum post here: http://forum.dlang.org/post/[email protected]
Comment #1 by reaperunreal — 2015-11-04T15:12:29Z
Any word on getting this fixed?
Comment #2 by dmitry.olsh — 2015-11-04T15:50:29Z
(In reply to Guillaume Couture-Levesque from comment #1) > Any word on getting this fixed? Been exceedingly busy, forgot about this issue. All in all I wanted to complete a big chunk of work On decode-less regex first then do a pass over issues. Does this block you in any way? If so I could give it a shot sometime during this week.
Comment #3 by reaperunreal — 2015-11-04T18:52:26Z
No, not blocking, just wondering if there was an update. Good luck on your other work.
Comment #4 by github-bugzilla — 2016-04-11T21:06:46Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/0e7fc33abaac676290add738499ec46d9e4be8ab Fix issue 14504 Regex Optimizer doesn't merge equivalent threads We can be unprecise a bit by using a hash of table to represent a state of optimizer thread, after all any collision will result in just a shorter prefix search. https://github.com/D-Programming-Language/phobos/commit/11ef8c4a11dfcd397b5ba6a6e62344cc429d7715 Merge pull request #4157 from DmitryOlshansky/issue14504 Fix issue 14504 Regex Optimizer doesn't merge equivalent threads