Open
Bug 1375676
Opened 8 years ago
Updated 8 months ago
Can JSObject::callHook() tail recurse and therefore be surprisingly expensive?
Categories
(Core :: JavaScript Engine, enhancement, P3)
Core
JavaScript Engine
Tracking
()
NEW
People
(Reporter: ehsan.akhgari, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: perf)
See this profile: http://bit.ly/2t0DWM8
Why is JSObject::callHook() taking 284ms self time?
The only possible explanation I could come up with was that we end up in the following sequence:
* https://searchfox.org/mozilla-central/rev/3291398f10dcbe192fb52e74974b172616c018aa/js/src/jsobj.cpp#2232
* https://searchfox.org/mozilla-central/rev/3291398f10dcbe192fb52e74974b172616c018aa/js/src/proxy/Wrapper.cpp#286
* https://searchfox.org/mozilla-central/rev/3291398f10dcbe192fb52e74974b172616c018aa/js/src/jsobj.cpp#2205
* Back to JSObject::callHook()
Comment 1•8 years ago
|
||
From the inverted stack it seems we're using instanceof on a CCW. So unwrapping there probably wouldn't be too surprising... Hopefully Jason's wrapper work will eliminate this one.
We also really need to inline JSObject::isCallable() and JSObject::callHook() - I noticed this also affects Object.prototype.toString.
Updated•8 years ago
|
Whiteboard: [qf] → [qf:p1]
Updated•8 years ago
|
Depends on: same-compartment-realms
Updated•7 years ago
|
Whiteboard: [qf:p1] → [qf:p2]
Updated•7 years ago
|
Priority: -- → P3
Updated•7 years ago
|
Whiteboard: [qf:p2] → [qf:f63][qf:p1]
Updated•7 years ago
|
Whiteboard: [qf:f63][qf:p1] → [qf:f64][qf:p1]
Updated•7 years ago
|
Whiteboard: [qf:f64][qf:p1] → [qf:p1:f64]
Comment 2•7 years ago
|
||
We inline JSObject::isCallable/callHook now so this is probably no longer as bad. Also the same-compartment-realms work will likely fix this by getting rid of the wrappers - I think we should just wait for that..
Updated•2 years ago
|
Severity: normal → S3
Updated•8 months ago
|
Blocks: sm-runtime
You need to log in
before you can comment on or make changes to this bug.
Description
•