Summary: | Loading cnn.com in MiniBrowser hits Structure::dump() under DFG::AdaptiveInferredPropertyValueWatchpoint::handleFire which churns 65KB of memory | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Simon Fraser (smfr) <simon.fraser> | ||||||
Component: | JavaScriptCore | Assignee: | Keith Miller <keith_miller> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, ews-watchlist, keith_miller, mark.lam, msaboff, saam, simon.fraser, webkit-bug-importer, ysuzuki | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Simon Fraser (smfr)
2018-06-09 17:19:33 PDT
Should DFG::AdaptiveInferredPropertyValueWatchpoint::handleFire() really be doing: StringPrintStream out; out.print("Adaptation of ", key(), " failed: ", detail); This code path is responsible for a bunch of memory allocations: fastMalloc allocation 8718 1 0x114d8bcc1 WTF::fastMalloc(unsigned long) 2 0x114de71a4 WTF::StringPrintStream::increaseSize(unsigned long) 3 0x114de6fcd WTF::StringPrintStream::vprintf(char const*, __va_list_tag*) 4 0x114dc5ba0 WTF::PrintStream::printf(char const*, ...) 5 0x114dc5dc9 WTF::printInternal(WTF::PrintStream&, char const*) 6 0x114dc69b2 void WTF::PrintStream::printImpl<char const*>(char const* const&) 7 0x114dc6970 void WTF::PrintStream::print<char const*>(char const* const&)::'lambda'(WTF::PrintStream&)::operator()(WTF::PrintStream&) const 8 0x114dc6935 void WTF::PrintStream::atomically<void WTF::PrintStream::print<char const*>(char const* const&)::'lambda'(WTF::PrintStream&)>(void WTF::PrintStream::print<char const*>(char const* const&)::'lambda'(WTF::PrintStream&) const&) 9 0x114dc5f58 void WTF::PrintStream::print<char const*>(char const* const&) 10 0x114dc5f25 WTF::printInternal(WTF::PrintStream&, WTF::CString const&) 11 0x114dc681f void WTF::PrintStream::printImpl<WTF::CString>(WTF::CString const&) 12 0x114dc67e0 void WTF::PrintStream::print<WTF::CString>(WTF::CString const&)::'lambda'(WTF::PrintStream&)::operator()(WTF::PrintStream&) const 13 0x114dc67a5 void WTF::PrintStream::atomically<void WTF::PrintStream::print<WTF::CString>(WTF::CString const&)::'lambda'(WTF::PrintStream&)>(void WTF::PrintStream::print<WTF::CString>(WTF::CString const&)::'lambda'(WTF::PrintStream&) const&) 14 0x114dc64f8 void WTF::PrintStream::print<WTF::CString>(WTF::CString const&) 15 0x114dc5ec1 WTF::printExpectedCStringHelper(WTF::PrintStream&, char const*, std::experimental::fundamentals_v3::expected<WTF::CString, WTF::UTF8ConversionError>) 16 0x114dc600b WTF::printInternal(WTF::PrintStream&, WTF::StringImpl const*) 17 0x115222ce0 WTF::printInternal(WTF::PrintStream&, WTF::UniquedStringImpl const*) 18 0x115222c9d WTF::printInternal(WTF::PrintStream&, WTF::UniquedStringImpl*) 19 0x11618bcef void WTF::PrintStream::printImpl<WTF::UniquedStringImpl*, char [2], int>(WTF::UniquedStringImpl* const&, char const (&) [2], int const&) 20 0x11618bcb5 void WTF::PrintStream::printImpl<WTF::CommaPrinter, WTF::UniquedStringImpl*, char [2], int>(WTF::CommaPrinter const&, WTF::UniquedStringImpl* const&, char const (&) [2], int const&) 21 0x11618bc5f void WTF::PrintStream::print<WTF::CommaPrinter, WTF::UniquedStringImpl*, char [2], int>(WTF::CommaPrinter const&, WTF::UniquedStringImpl* const&, char const (&) [2], int const&)::'lambda'(WTF::PrintStream&)::operator()(WTF::PrintStream&) const 22 0x11618bc15 void WTF::PrintStream::atomically<void WTF::PrintStream::print<WTF::CommaPrinter, WTF::UniquedStringImpl*, char [2], int>(WTF::CommaPrinter const&, WTF::UniquedStringImpl* const&, char const (&) [2], int const&)::'lambda'(WTF::PrintStream&)>(void WTF::PrintStream::print<WTF::CommaPrinter, WTF::UniquedStringImpl*, char [2], int>(WTF::CommaPrinter const&, WTF::UniquedStringImpl* const&, char const (&) [2], int const&)::'lambda'(WTF::PrintStream&) const&) 23 0x11618bbcc void WTF::PrintStream::print<WTF::CommaPrinter, WTF::UniquedStringImpl*, char [2], int>(WTF::CommaPrinter const&, WTF::UniquedStringImpl* const&, char const (&) [2], int const&) 24 0x11618bb6b JSC::Structure::dump(WTF::PrintStream&) const::$_7::operator()(JSC::PropertyMapEntry const&) const 25 0x11617c45f void JSC::Structure::forEachPropertyConcurrently<JSC::Structure::dump(WTF::PrintStream&) const::$_7>(JSC::Structure::dump(WTF::PrintStream&) const::$_7 const&) 26 0x11617c150 JSC::Structure::dump(WTF::PrintStream&) const 27 0x11617c6aa JSC::Structure::dumpInContext(WTF::PrintStream&, JSC::DumpContext*) const 28 0x115309d57 WTF::ValueInContext<JSC::Structure, JSC::DumpContext>::dump(WTF::PrintStream&) const 29 0x115309d1d void WTF::printInternal<WTF::ValueInContext<JSC::Structure, JSC::DumpContext> >(WTF::PrintStream&, WTF::ValueInContext<JSC::Structure, JSC::DumpContext> const&) These are the > 1024 byte allocations I see under this call stack: fastMalloc allocation 1080 fastMalloc allocation 2162 fastMalloc allocation 4354 fastMalloc allocation 8718 fastMalloc allocation 5461 fastMalloc allocation 1080 fastMalloc allocation 2162 fastMalloc allocation 4354 fastMalloc allocation 8718 fastMalloc allocation 5461 fastMalloc allocation 1080 fastMalloc allocation 2162 fastMalloc allocation 4354 fastMalloc allocation 8718 fastMalloc allocation 5461 That's a lot of memory churn for a string that no-one cares about. AdaptiveStructureWatchpoint::fireInternal() does this too. And ArrayPrototypeAdaptiveInferredPropertyWatchpoint::handleFire() Nice, yeah, creating these strings is a pure overhead if we do not dump watch point firing information. Created attachment 342489 [details]
Patch
Comment on attachment 342489 [details] Patch Rejecting attachment 342489 [details] from commit-queue. Number of test failures exceeded the failure limit. Full output: http://webkit-queues.webkit.org/results/8139751 Created attachment 342497 [details]
Archive of layout-test-results from webkit-cq-02 for mac-sierra
The attached test failures were seen while running run-webkit-tests on the commit-queue.
Bot: webkit-cq-02 Port: mac-sierra Platform: Mac OS X 10.12.6
Ugh, none of those failures are probably relevant to my patch... That's what I get for using cq. Committed r232738: <https://trac.webkit.org/changeset/232738> |