RESOLVED FIXED 97974
[V8] ScriptWrappable should hold the wrapper handle directly (Dromaeo/dom-modify and dom-traverse get ~2.5% faster)
https://bugs.webkit.org/show_bug.cgi?id=97974
Summary [V8] ScriptWrappable should hold the wrapper handle directly (Dromaeo/dom-mod...
Adam Barth
Reported 2012-09-29 21:02:30 PDT
[V8] ScriptWrappable should hold the wrapper handle directly (Dromaeo/dom-traverse gets 3% faster)
Attachments
Patch (6.92 KB, patch)
2012-09-29 21:04 PDT, Adam Barth
no flags
Patch (6.90 KB, patch)
2012-09-29 22:07 PDT, Adam Barth
no flags
Work in progress---does not compile (10.64 KB, patch)
2012-09-30 08:54 PDT, Adam Barth
no flags
Patch (12.08 KB, patch)
2012-10-01 12:59 PDT, Adam Barth
no flags
Patch (11.95 KB, patch)
2012-10-01 16:14 PDT, Adam Barth
no flags
work-in-progress (15.90 KB, patch)
2012-10-05 13:30 PDT, Adam Barth
no flags
Patch (12.59 KB, patch)
2012-10-22 14:45 PDT, Adam Barth
no flags
perf test results (first five are with patch; last five are without) (74.42 KB, text/html)
2012-10-22 14:51 PDT, Adam Barth
no flags
Patch (14.96 KB, patch)
2012-10-22 15:33 PDT, Adam Barth
no flags
Adam Barth
Comment 1 2012-09-29 21:04:15 PDT
Dimitri Glazkov (Google)
Comment 2 2012-09-29 21:49:48 PDT
Comment on attachment 166376 [details] Patch u so purple
Adam Barth
Comment 3 2012-09-29 22:04:38 PDT
Comment on attachment 166376 [details] Patch Yeah, I need to merge to HEAD.
Adam Barth
Comment 4 2012-09-29 22:07:20 PDT
Adam Barth
Comment 5 2012-09-29 23:13:07 PDT
Comment on attachment 166378 [details] Patch Looks like I made everything crash. :)
Adam Barth
Comment 6 2012-09-30 08:54:31 PDT
Created attachment 166386 [details] Work in progress---does not compile
Adam Barth
Comment 7 2012-10-01 12:59:38 PDT
Eric Seidel (no email)
Comment 8 2012-10-01 15:57:14 PDT
Comment on attachment 166528 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=166528&action=review > Source/WebCore/bindings/v8/IntrusiveDOMWrapperMap.h:95 > + // OOPS! Figure out what to do here. > + // MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Binding); > + // info.addMember(m_table); Other than this OOPS it looks fine. :)
Adam Barth
Comment 9 2012-10-01 16:14:36 PDT
Adam Barth
Comment 10 2012-10-01 16:14:48 PDT
Now with less "oops"
Kentaro Hara
Comment 11 2012-10-01 16:49:49 PDT
Comment on attachment 166566 [details] Patch OK. Great improvement.
WebKit Review Bot
Comment 12 2012-10-01 17:15:53 PDT
Comment on attachment 166566 [details] Patch Clearing flags on attachment: 166566 Committed r130103: <http://trac.webkit.org/changeset/130103>
WebKit Review Bot
Comment 13 2012-10-01 17:15:57 PDT
All reviewed patches have been landed. Closing bug.
Kentaro Hara
Comment 15 2012-10-01 22:51:05 PDT
Awesome!
Ojan Vafai
Comment 16 2012-10-01 23:11:49 PDT
This is hitting an assert on the chromium debug bots. http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=plugins%2Freentrant-update-widget-positions.html%20svg%2Fas-image%2Fimg-preserveAspectRatio-support-1.html%20userscripts%2Fuser-script-top-frame-only.html%20svg%2FW3C-I18N%2Ftspan-dirLTR-ubOverride-in-rtl-context.svg%20http%2Ftests%2Fsecurity%2FisolatedWorld%2Fall-window-prototypes.html%20http%2Ftests%2Fsecurity%2FisolatedWorld%2Fevents.html%20http%2Ftests%2Fsecurity%2FisolatedWorld%2FuserGestureEvents.html%20http%2Ftests%2Fsecurity%2FjavascriptURL%2FjavascriptURL-execution-context-frame-src-htmldom.html%20http%2Ftests%2Fsecurity%2FisolatedWorld%2Fcontext-destroy.html%20http%2Ftests%2Fsecurity%2FisolatedWorld%2Fdocument-prototype.html%20http%2Ftests%2Fsecurity%2FisolatedWorld%2Fnumber-prototype.html%20http%2Ftests%2Fsecurity%2FisolatedWorld%2Fworld-reuse.html%20inspector%2Fextensions%2Fextensions-audits.html%20storage%2Fwebsql%2Ftransaction-error-callback-isolated-world.html%20 STDERR: ASSERTION FAILED: wrapper == value STDERR: third_party/WebKit/Source/WebCore/bindings/v8/IntrusiveDOMWrapperMap.h(80) : virtual bool WebCore::IntrusiveDOMWrapperMap::removeIfPresent(WebCore::Node*, v8::Persistent<v8::Object>) STDERR: WebCore::IntrusiveDOMWrapperMap::removeIfPresent() [0x7f26c88926cc] STDERR: WebCore::DOMDataStore::weakNodeCallback() [0x7f26c884f729] STDERR: v8::internal::GlobalHandles::Node::PostGarbageCollectionProcessing() [0x7f26c582a8aa] STDERR: v8::internal::GlobalHandles::PostGarbageCollectionProcessing() [0x7f26c5829384] STDERR: v8::internal::Heap::PerformGarbageCollection() [0x7f26c583b27c] STDERR: v8::internal::Heap::CollectGarbage() [0x7f26c583a596] STDERR: v8::internal::Heap::CollectGarbage() [0x7f26c57a6f2b] STDERR: v8::internal::AbortIncrementalMarkingAndCollectGarbage() [0x7f26c583a7d3] STDERR: v8::internal::Heap::ReserveSpace() [0x7f26c583a8f3] STDERR: v8::internal::Deserializer::DeserializePartial() [0x7f26c5a4fb2e] STDERR: v8::internal::Snapshot::NewContextFromSnapshot() [0x7f26c5a57344] STDERR: v8::internal::Genesis::Genesis() [0x7f26c578b726] STDERR: v8::internal::Bootstrapper::CreateEnvironment() [0x7f26c5780896] STDERR: v8::Context::New() [0x7f26c575429c] STDERR: WebCore::V8DOMWindowShell::createContext() [0x7f26c889988a] STDERR: WebCore::V8DOMWindowShell::initializeIfNeeded() [0x7f26c889916c] STDERR: WebCore::ScriptController::evaluateInIsolatedWorld() [0x7f26c886d341] STDERR: WebKit::WebFrameImpl::executeScriptInIsolatedWorld() [0x7f26c77f29d7] STDERR: DRTTestRunner::evaluateScriptInIsolatedWorld() [0x4994e6] STDERR: CppBoundClass::MemberCallback<>::run() [0x4a71e8] STDERR: CppBoundClass::invoke() [0x4e646c] STDERR: CppNPObject::invoke() [0x4e5b4b] STDERR: WebCore::npObjectInvokeImpl() [0x7f26c88a5d2b] STDERR: WebCore::npObjectMethodHandler() [0x7f26c88a5ed2] STDERR: v8::internal::HandleApiCallHelper<>() [0x7f26c579bf26] STDERR: v8::internal::Builtin_Impl_HandleApiCall() [0x7f26c5796b85] STDERR: v8::internal::Builtin_HandleApiCall() [0x7f26c5796b56]
Adam Barth
Comment 17 2012-10-01 23:26:55 PDT
/me will fix.
Adam Barth
Comment 18 2012-10-01 23:31:55 PDT
Ojan Vafai
Comment 19 2012-10-02 11:09:18 PDT
Ojan Vafai
Comment 20 2012-10-02 11:10:04 PDT
This caused regressions on the Dromaeo tests and was rolled out in http://trac.webkit.org/changeset/130189. http://build.chromium.org/f/chromium/perf/chromium-rel-win7-webkit/dom_perf/report.html?history=150&rev=-1&graph=Get%20Elements http://build.chromium.org/f/chromium/perf/chromium-rel-win7-webkit/dromaeo_domcoreattr/report.html?history=150&rev=-1&graph=dom_attr_element_expando___value http://build.chromium.org/f/chromium/perf/chromium-rel-win7-webkit/dromaeo_jslibtraversejquery/report.html?history=150&rev=-1&graph=jslib_traverse_jquery_jQuery___parents_x10 http://trac.webkit.org/log/?verbose=on&rev=130105&stop_rev=130077 http://build.chromium.org/f/chromium/perf/linux-release-webkit-latest/dromaeo_domcoremodify/report.html?history=150&rev=-1&graph=dom_modify http://build.chromium.org/f/chromium/perf/linux-release-webkit-latest/dromaeo_domcoremodify/report.html?history=150&rev=-1&graph=dom_modify_createTextNode http://build.chromium.org/f/chromium/perf/linux-release-webkit-latest/dromaeo_domcoremodify/report.html?history=150&rev=-1&graph=dom_modify_createElement http://trac.webkit.org/log/?verbose=on&rev=130105&stop_rev=130100 http://build.chromium.org/f/chromium/perf/mac-release-10.6-webkit-latest/dromaeo_domcoremodify/report.html?history=150&rev=-1&graph=dom http://build.chromium.org/f/chromium/perf/mac-release-10.6-webkit-latest/dom_perf/report.html?history=150&rev=-1&graph=Template http://build.chromium.org/f/chromium/perf/mac-release-10.6-webkit-latest/dom_perf/report.html?history=150&rev=-1&graph=Get%20Elements http://build.chromium.org/f/chromium/perf/mac-release-10.6-webkit-latest/dom_perf/report.html?history=150&rev=-1&graph=CreateNodes http://build.chromium.org/f/chromium/perf/mac-release-10.6-webkit-latest/dom_perf/report.html?history=150&rev=-1&graph=CloneNodes http://trac.webkit.org/log/?verbose=on&rev=130105&stop_rev=130091
Ojan Vafai
Comment 21 2012-10-02 11:51:24 PDT
Ignore the dom_attr regression. That was the v8 roll.
Adam Barth
Comment 22 2012-10-05 13:30:50 PDT
Created attachment 167375 [details] work-in-progress
Adam Barth
Comment 23 2012-10-22 14:45:04 PDT
Adam Barth
Comment 24 2012-10-22 14:51:07 PDT
Created attachment 169992 [details] perf test results (first five are with patch; last five are without) Summary of perf results (average of five runs): gc-forest: 3.60% worse gc-mini-tree: 2.81% worse gc-tree: 8.05% worse dom-attr: 1.00% better dom-modify: 2.48% better dom-query: 1.40% worse dom-traverse: 2.82% better Note: These numbers include both the patch in this bug and the patch in bug 100033, which is also needed. Essentially, we're gaining DOM performance at the cost of some GC performance. This already seems like a good trade-off, but it will be a no-brainer trade-off after bug 98725 lands because most of the GC load will be shifted to the minor GC phase, which isn't slowed down at all. Also, there is a memory savings because we don't need to maintain an extra pointer's worth of data for every wrapped node anymore.
Adam Barth
Comment 25 2012-10-22 15:33:12 PDT
Eric Seidel (no email)
Comment 26 2012-10-22 15:49:35 PDT
Have we verified already that this is "no brainer after 98725"?
Adam Barth
Comment 27 2012-10-22 15:54:23 PDT
> Have we verified already that this is "no brainer after 98725"? I haven't. I haven't made a build with all the dependent patches for bug 98725, but the point of that bug is to shrink the time spent in major GC by a factor of 10, which makes this slowdown even less relevant.
Eric Seidel (no email)
Comment 28 2012-10-22 15:55:50 PDT
(In reply to comment #27) > > Have we verified already that this is "no brainer after 98725"? > > I haven't. I haven't made a build with all the dependent patches for bug 98725, but the point of that bug is to shrink the time spent in major GC by a factor of 10, which makes this slowdown even less relevant. I see. It would be good to make sure we know to check back after the dust settles to make sure we end up faster in the ways we care about, that's all.
Eric Seidel (no email)
Comment 29 2012-10-22 15:56:38 PDT
Comment on attachment 170000 [details] Patch OK. LGTM. Same disclaimer as always for v8 patches: You may still want to talk to kentaro. :)
Adam Barth
Comment 30 2012-10-22 15:57:28 PDT
<abarth> eseidel: DOM operations occur massively more often than garbage collection. speeding up DOM operations is a much greater benefit than the cost of slowing down major gc by a couple percent <eseidel> abarth: I agree. a lso be good to put that on the bug :)
Kentaro Hara
Comment 31 2012-10-22 23:54:31 PDT
Great patch! Would you wait to land the patch for a couple of days? I'm now looking into a crash bug (http://code.google.com/p/chromium/issues/detail?id=155942), and I'm suspecting that the patches around bug 98567 (which this patch depends on) might be the culprit.
Kentaro Hara
Comment 32 2012-10-23 07:33:54 PDT
(In reply to comment #31) > Great patch! > > Would you wait to land the patch for a couple of days? I'm now looking into a crash bug (http://code.google.com/p/chromium/issues/detail?id=155942), and I'm suspecting that the patches around bug 98567 (which this patch depends on) might be the culprit. hmm, it looks like bug 98567 is not the culprit. (As I commented in Chromium issue 155942, the bug does not happen in WebKit ToT.) Sorry for the noise.
Adam Barth
Comment 33 2012-10-23 11:14:22 PDT
Comment on attachment 170000 [details] Patch Clearing flags on attachment: 170000 Committed r132245: <http://trac.webkit.org/changeset/132245>
Adam Barth
Comment 34 2012-10-23 11:14:26 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.