Bug 126077
Summary: | Rewrite Text node attaching to not be N^2 in HTML parser | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> |
Component: | Page Loading | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | ahmad.saleem792, barraclough, benjamin, bfulgham, cdumez, gavinp, kling, koivisto |
Priority: | P2 | Keywords: | BlinkMergeCandidate |
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Ryosuke Niwa
Consider merging https://chromium.googlesource.com/chromium/blink/+/4a1cb7c3ac3015f577bb04fe60dac68df478e70b
Previously Text node creation used String::append which was N^2.
Now instead we use StringBuilder, batch up all the text from
the network and then split it into Text nodes if necessary
all at once.
This should be a perf win for pages with large text nodes
and slow networks.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Brent Fulgham
Was this ever evaluated? Can we close this bug if we don't think this is relevant or useful for us?
Ryosuke Niwa
Antti, didn't you fix this?
Antti Koivisto
No, I haven't done anything with text nodes. The blink commit doesn't indicate if this was an observed problem rather than a theoretical one. As far as I see this isn't an actual O(n^2) because we limit the text node length to 64k characters and split them up as needed.
Ahmad Saleem
@Chris - something needed?