Closed Bug 901900 Opened 11 years ago Closed 5 years ago

performance of javascript across iframe boundary is quite low

Categories

(Core :: JavaScript Engine, defect)

23 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: duanyao.ustc, Unassigned)

References

()

Details

(Whiteboard: DUPME)

Attachments

(1 file)

Attached file testCalcIFrame.htm
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.
Whiteboard: DUPME
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: nobody → general
Status: UNCONFIRMED → NEW
Component: DOM: Core & HTML → JavaScript Engine
Ever confirmed: true
Depends on: 875452
Depends on: 907369
Assignee: general → nobody
Attachment #786231 - Attachment mime type: text/plain → text/html

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

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: