Closed
Bug 1405330
Opened 7 years ago
Closed 7 years ago
Clean up and optimize Promise debugger hooks
Categories
(Core :: JavaScript Engine, enhancement)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla58
Tracking | Status | |
---|---|---|
firefox58 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file)
(deleted),
patch
|
till
:
review+
|
Details | Diff | Splinter Review |
The Promise constructor spends quite a lot of time under JS::dbg::onNewPromise. Fortunately this no longer has to be a public API and we can now simplify/optimize this code. In particular the fast path can just check cx->compartment()->isDebuggee().
This improves the micro-benchmark below from 360-390 ms to 340-350 ms with --no-async-stacks so it's a pretty easy win.
function f() {
var count = 1000000;
var start = Date.now();
for (var i = 0; i < count; ++i) {
new Promise(r => void 0);
}
var stop = Date.now();
print(stop - start);
}
f();
Attachment #8914760 -
Flags: review?(till)
Comment 1•7 years ago
|
||
Comment on attachment 8914760 [details] [diff] [review]
Patch
Review of attachment 8914760 [details] [diff] [review]:
-----------------------------------------------------------------
Nice easy win indeed, thanks!
Attachment #8914760 -
Flags: review?(till) → review+
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0b08540034c0
Clean up and optimize Promise debugger hooks. r=till
Backed out for failures like https://treeherder.mozilla.org/logviewer.html#?job_id=134744425&repo=mozilla-inbound
https://hg.mozilla.org/integration/mozilla-inbound/rev/810131b10010bc4f2be43d63a7dc1abe31d327cb
Flags: needinfo?(jdemooij)
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/df08c7645b1a
Clean up and optimize Promise debugger hooks. r=till
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(jdemooij)
Comment 5•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in
before you can comment on or make changes to this bug.
Description
•