performance of javascript across iframe boundary is quite low
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
People
(Reporter: duanyao.ustc, Unassigned)
References
()
Details
(Whiteboard: DUPME)
Attachments
(1 file)
2.12 KB,
text/html
|
Details |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0 (Beta/Release) Build ID: 20130729175331 Steps to reproduce: Open attached html file(or the URL) in Firefox, click these button to test the JS performance of: 1. codes run across iframe boundary (testCalcIFrame). codes in the main document make many calls to codes in the iframe. 2. codes run in the main document (testCalc) 3. codes run in the iframe (testCalcAllIframe) Actual results: codes run across iframe boundary are much slower (~8x) than codes run entirely in either main document or iframe. Expected results: codes run across iframe boundary are largely as fast as codes run entirely in one document.
Google Chrome 28 does not suffer from this problem, codes run across iframe boundary are as fast as codes run entirely in one document. IE 11 has similar problem, but is still better than Firefox 23.
Updated•11 years ago
|
Comment 2•11 years ago
|
||
This is a variant of bug 774119. Chrome's lack of this problem comes at the expense of cross-site information leaks via script due to lack of a security membrane at window boundaries; see http://lists.w3.org/Archives/Public/public-script-coord/2013AprJun/0621.html for one example and we've reported worse ones to them recently (sadly, they're still security-embargoed). We should reevaluate the performance story once bug 875452 is done; ideally for same-origin cross-compartment wrappers we can make things reasonably fast.
Assignee | ||
Updated•10 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 3•5 years ago
|
||
This is fixed now. We're actually a bit faster than Chrome and Safari because they get numbers > 20 ms on each of these tests usually. testCalcIFrame is still a little bit slower, this is likely because we don't inline scripted functions cross-realm, but we're still on par with other browsers.
Firefox 65:
testCalcIFrame(1000000):time:180, result:499999
testCalcIFrame(1000000):time:167, result:499999
testCalcIFrame(1000000):time:161, result:499999
testCalc(1000000):time:22, result:499999
testCalc(1000000):time:20, result:499999
testCalc(1000000):time:22, result:499999
testCalcAllIframe(1000000):time:14, result:499999
testCalcAllIframe(1000000):time:13, result:499999
testCalcAllIframe(1000000):time:13, result:499999
Nightly:
testCalcIFrame(1000000):time:26, result:499999
testCalcIFrame(1000000):time:22, result:499999
testCalcIFrame(1000000):time:22, result:499999
testCalc(1000000):time:15, result:499999
testCalc(1000000):time:13, result:499999
testCalc(1000000):time:13, result:499999
testCalcAllIframe(1000000):time:15, result:499999
testCalcAllIframe(1000000):time:14, result:499999
testCalcAllIframe(1000000):time:13, result:499999
Description
•