Closed
Bug 1213676
Opened 10 years ago
Closed 1 year ago
Lookahead regular expressions take significantly longer in web workers
Categories
(Core :: DOM: Workers, defect, P5)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: jmareda, Unassigned)
References
()
Details
(Keywords: perf, testcase, Whiteboard: dom-lws-bugdash-triage)
Attachments
(2 files)
I was trying to let a worker perform complex regular expressions to prevent blocking UI thread (regular expression execution is synchronous). Turns out that in worker, my expression with lookahead formula executes about three times longer.
Since I was not ale to reproduce such a time difference in other browsers (including Firefox mobile) I assume this is Firefox desktop specific bug.
[Demo](http://u8.8u.cz/testing/workers/)
[Detailed description (StackOverflow)](http://stackoverflow.com/q/32910126/607407)
Reporter | ||
Updated•10 years ago
|
![]() |
||
Comment 1•10 years ago
|
||
I am not sure, but I think the size of massage is relatively big in this case.
(ref https://hacks.mozilla.org/2015/07/how-fast-are-web-workers/)
Keywords: perf
Reporter | ||
Comment 2•10 years ago
|
||
Nope, the size of message isn't big. And definitely does not significantly contribute to the delay.
Comment 3•10 years ago
|
||
Comment 4•10 years ago
|
||
Comment 5•10 years ago
|
||
I can reproduce on current Nightly on OS X. The inline version takes ~2s, while the same script in a web worker takes ~14s. The sample from the Activity Monitor seems to indicate the regexp JIT doesn't kick in for the worker (all the samples are in js::irregexp::InterpretCode), while for the inline script case the samples include what seems to be JITed code.
Updated•8 years ago
|
Priority: -- → P5
Updated•3 years ago
|
Severity: normal → S3
Comment 6•1 year ago
|
||
Most likely we enabled jit on workers in the meantime?
Flags: needinfo?(bugmail)
Comment 7•1 year ago
|
||
A potentially scary thing is that the regex now takes much longer than 2 seconds on the main thread (the time listed in comment 5) but the profiler confirms that we end up in js::irregexp::Execute
on both the main thread and in the worker and the samples beneath that are all unsymbolicated JIT, so the JIT is working.
Status: NEW → RESOLVED
Closed: 1 year ago
Flags: needinfo?(bugmail)
Resolution: --- → WORKSFORME
Updated•1 year ago
|
Whiteboard: dom-lws-bugdash-triage
You need to log in
before you can comment on or make changes to this bug.
Description
•