devtools.timeline adds lots of overhead to custom elements inserted by the parser |
|||||||
Issue descriptionhttps://cs.chromium.org/chromium/src/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp?q=callFunction&sq=package:chromium&l=506 The recursion count will always be 0 inside the parser, so the constructor, attributeChangedCallback, and connectedCallbacks will all do this code: TRACE_EVENT_BEGIN1("devtools.timeline", "FunctionCall", "data", InspectorFunctionCallEvent::data(context, function)); which adds quite a lot of overhead doing malloc, copying strings, and more. Note that they're discussing adding some kind of long task system for the web in general like: https://docs.google.com/document/d/125d69JAC7nyx-Ob0a9Z31d1uHUGu4myYQ3os9EnGfdU/edit# which would have similar issues adding lots of overhead to the very spammy custom elements v1 callbacks.
,
Sep 22 2016
Elliot, is there a testcase to play with? Thanks.
,
Sep 22 2016
Driveby: Should we (someone instrumentation, not specifically alph) add coverage of this category to zhen's trace event rate/bytes benchmark so we lock in this win?
,
Sep 22 2016
,
Sep 23 2016
A test case would be something like https://gist.github.com/esprehn/a56b379b03b2123aa11f02cb7fb7ad75 You want to make the parser insert a bunch of custom elements with callbacks, it needs to come direct from the parser so the depth counter is zero. In general I think we need to rethink the amount of instrumentation overhead in callFunction and callConstructor, I count 15+ branches in there, lots of redundant checks in various inspector, tracing and sanity asserts, etc. This was fine back when entering/exiting script was rare, ex. event handlers, setTimeout, etc. But custom elements is wants to go through these code paths thousands of times. That's a more general bug with the V8ScriptRunner though.
,
Sep 23 2016
,
Aug 28 2017
,
Sep 1 2017
,
Dec 4
Archiving feature requests that we are unlikely to address during the next 18 months. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by pfeldman@chromium.org
, Sep 14 2016Status: Assigned (was: Untriaged)