Closed
Bug 1369762
Opened 7 years ago
Closed 7 years ago
Avoid string atomization in FinishBoundFunctionInit when the bound target name is empty
Categories
(Core :: JavaScript Engine, enhancement)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
1.40 KB,
patch
|
till
:
review+
|
Details | Diff | Splinter Review |
These Function#bind() calls from Speedometer still show up in profiles, because of the function name atomization overhead in JSFunction::getUnresolvedName(): https://github.com/WebKit/webkit/blob/c3cb7eecbd14e0cf97f55b1014340e5b474da8d1/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/js/app.jsx#L292-L294 "setState" is a bound function created in https://github.com/WebKit/webkit/blob/c3cb7eecbd14e0cf97f55b1014340e5b474da8d1/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/node_modules/react/dist/react.min.js , but luckily it's anonymous function, so we can optimize for this case in JSFunction::getUnresolvedName() by special-casing empty function names. Yay! :-/
Assignee | ||
Comment 1•7 years ago
|
||
Improves this µ-benchmark (should be similar to the React benchmark from Speedometer) from 540ms to 330ms. var o = {}; o.m = function(){}.bind(o); var t = Date.now(); for (var i = 0; i < 5000000; ++i) o.m.bind(); print(Date.now() - t);
Attachment #8873877 -
Flags: review?(till)
Comment 2•7 years ago
|
||
Comment on attachment 8873877 [details] [diff] [review] bug1369762.patch Review of attachment 8873877 [details] [diff] [review]: ----------------------------------------------------------------- r=me, that's an excellent speedup for such a small change.
Attachment #8873877 -
Flags: review?(till) → review+
Assignee | ||
Comment 3•7 years ago
|
||
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=5c2f4711c9d7c5e898216a8a1a893dded9170aa5
Keywords: checkin-needed
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/45eded6a52c0 Don't atomize empty function names when retrieving the unresolved name of a bound function. r=till
Keywords: checkin-needed
Comment 5•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/45eded6a52c0
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in
before you can comment on or make changes to this bug.
Description
•