phobos
phobos copied to clipboard
Fix slow compilation when using std.regex
Taking this short program as an example:
import std.regex, std.stdio;
void main(string[] argv) {
auto re = regex(argv[1]);
auto matches = matchFirst(argv[2], re);
writeln(matches);
}
Before:
time dmd re.d
real 0m2,404s
user 0m2,205s
sys 0m0,200s
After:
time dmd re.d
real 0m1,198s
user 0m1,103s
sys 0m0,096s
I still think the compile time is too big, maybe there is another CTFE-heavy construction hiding in there.
Thanks for your pull request, @DmitryOlshansky!
Bugzilla references
Your PR doesn't reference any Bugzilla issue.
If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
Testing this PR locally
If you don't have a local development environment setup, you can use Digger to test this PR:
dub run digger -- build "master + phobos#8628"
@RazvanN7 I don't get cirrus-ci failing on some UDA test in std.traits that shouldn't be affected by my code at all. Any ideas?
You should probably rebase to the latest version of phobos, that will most likely fix it.
In general I approve this pr