Very slow chrome to content DOM access

NEW
Assigned to

Status

()

Core
XPConnect
7 years ago
19 days ago

People

(Reporter: bz, Assigned: ting)

Tracking

(Depends on: 3 bugs, Blocks: 3 bugs)

Trunk
x86
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [qf:p1])

Attachments

(1 attachment)

The steps are in bug 613487.

Profile says:

  4% in js_Interpret
  4% GC
 89% under js::proxy_GetProperty

The property get time is about half XrayWrapper::getPropertyDescriptor and half JSCrossCompartmentWrapper::call.

Under getPropertyDescriptor we have:

 4% entering cross-compatment calls
 4% resolveOwnProperty on the wrapper
 9% JS_WrapValue
 8% JS_DefinePropertyById
 3% auto-entering compartments
 3% XPCCallContext ctors
 3% XPCNativeMember::resolve
 2% leaving cross-compartment calls

and some minor stuff.

Under call we have:

 4% self time in XPCWrappedNative::CallMethod
 2% XPCCallContext ctors
 8% NativeData2JS
 4% calling actual DOM methods (previousSibling, nextSibling, etc)
 4% nsScriptSecurityManager::CanAccess (from CallMethod).  Can we remove this
    yet?
 1% XPCCallContext::CanCallNow.
 1% ~CallMethodHelper.
 1% NS_IsMainThread_P
 1% various xptInterfaceEntry stuff.
So summary:

1)  Under call() this is all xpconnect suck.  No fast-path for wrapping, looks
    like, and probably useless security checks, plus general silliness.  Any way
    we could call quickstubs from the proxy code somehow?  ;)
2)  Under getPropertyDescriptor, about 10% of the total runtime is managing our
    compartment.  
3)  JS_WrapValue is mostly JSCompatment::wrap self time and JSWrapper::New.
4)  JS_DefinePropertyById is ending up in newShape, changeProperty,
    lookupProperty, putProperty, etc.
Blocks: 536910
Created attachment 8848224 [details]
Zip of testcase that can be used, since the other one is gone
Depends on: 1348095
Depends on: 1348099

Updated

3 months ago
Duplicate of this bug: 1334263
Blocks: 1337841
Whiteboard: [qf]
Whiteboard: [qf] → [qf:p1]
Blocks: 1258946
(Assignee)

Updated

2 months ago
Depends on: 1363956
(Assignee)

Updated

2 months ago
Assignee: nobody → janus926
(Assignee)

Updated

2 months ago
Depends on: 1363959
(Assignee)

Updated

2 months ago
Depends on: 1363963
(Assignee)

Comment 4

20 days ago
UncheckedUnwrap is now the top symbol on the reversed callstack after bug 1363963 landed, https://perfht.ml/2rrY3S3.
I suspect that bug 1355109 would help here more than anything else.
(Assignee)

Comment 6

19 days ago
If so, do I still need to work on bug 1348099? The numbers in bug 1348099 comment 27 and 29 look worthy though.
Depends on: 1355109
The patch in bug 1355109 should help with getters, but so far not with method calls or indexed access on lists.  So improving those cases would still be a good idea; I expect the patches in bug 1348099 do help with method calls.
You need to log in before you can comment on or make changes to this bug.