Bug 111789
Summary: | HTMLTreeBuilder::ExternalCharacterTokenBuffer should not need to copy bytes in the CompactHTMLToken case | ||
---|---|---|---|
Product: | WebKit | Reporter: | Eric Seidel (no email) <eric> |
Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED CONFIGURATION CHANGED | ||
Severity: | Normal | CC: | abarth, annevk, tonyg |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | |||
Bug Blocks: | 111645 |
Eric Seidel (no email)
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Anne van Kesteren
It looks like we're doing this today.