Bug 126077

Summary: Rewrite Text node attaching to not be N^2 in HTML parser
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: Page LoadingAssignee: 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
Reported 2013-12-20 11:38:11 PST
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
Brent Fulgham
Comment 1 2016-01-11 11:36:36 PST
Was this ever evaluated? Can we close this bug if we don't think this is relevant or useful for us?
Ryosuke Niwa
Comment 2 2016-01-11 13:28:04 PST
Antti, didn't you fix this?
Antti Koivisto
Comment 3 2016-01-12 06:03:21 PST
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
Comment 4 2023-09-26 18:55:36 PDT
@Chris - something needed?
Note You need to log in before you can comment on or make changes to this bug.