RESOLVED CONFIGURATION CHANGED 111789
HTMLTreeBuilder::ExternalCharacterTokenBuffer should not need to copy bytes in the CompactHTMLToken case
https://bugs.webkit.org/show_bug.cgi?id=111789
Summary HTMLTreeBuilder::ExternalCharacterTokenBuffer should not need to copy bytes i...
Eric Seidel (no email)
Reported 2013-03-07 16:09:49 PST
HTMLTreeBuilder::ExternalCharacterTokenBuffer should not need to copy bytes in the CompactHTMLToken case CompactHTMLToken has already allocated a StringImpl of the right size in the common case. We need to plumb this information through AtomicHTMLToken so that ExternalCharacterTokenBuffer can avoid copying the bytes and instead just ref the StringImpl. :) e.g. m_tree.insertTextNode(buffer.takeRemaining()); profiling Parser/html-parser-threaded.html with bug 107236 applied: Running Time Self Symbol Name 84.2ms 4.8% 84.2 WTF::fastMalloc(unsigned long) 19.6ms 1.1% 0.0 WTF::StringImpl::createUninitialized(unsigned int, unsigned char*&) 17.7ms 1.0% 0.0 WTF::String::make8BitFrom16BitSource(unsigned short const*, unsigned long) 8.3ms 0.4% 0.0 WebCore::HTMLTreeBuilder::processCharacterBufferForInBody(WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer&) The .4% spent in HTMLTreeBuilder::processCharacterBufferForInBody are likely all unnecessary.
Attachments
Anne van Kesteren
Comment 1 2023-04-01 00:52:28 PDT
It looks like we're doing this today.
Note You need to log in before you can comment on or make changes to this bug.