Bug 119308 - Avoid scanning really wide DOMs in textRendererIsNeeded
Summary: Avoid scanning really wide DOMs in textRendererIsNeeded
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BlinkMergeCandidate
Depends on:
Blocks:
 
Reported: 2013-07-30 20:52 PDT by Ryosuke Niwa
Modified: 2023-07-06 14:45 PDT (History)
10 users (show)

See Also:


Attachments
GitHub Desktop (1014.29 KB, image/png)
2023-07-06 14:45 PDT, Ahmad Saleem
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2013-07-30 20:52:27 PDT
Consider merging https://chromium.googlesource.com/chromium/blink/+/0643cdddb9b19d7515277dc40f68a85cf4ac1ca1

Avoiding creation of a Renderer for the text node is a non-essential memory
optimization. So to avoid blowing up on very wide DOMs, this patch limits the
number of siblings to visit to 50.

It improves the page load time of http://alexaing.com/ (slowest parse time in
alexa top million) from 16.4s -> 4.4s on my z620 linux workstation.
Comment 1 Ahmad Saleem 2022-09-24 02:46:28 PDT
*** In Text.cpp ***

containsOnlyWhitespace does not exist but it exists in:

https://github.com/WebKit/WebKit/blob/43e883ca6575a2913f7d63b35b4fd02ffbe68681/Source/WebCore/editing/cocoa/DataDetection.mm#L381

I tried to find it via "WS" or "Whitespace" but nothing came up.

While I found "isFloatingOrOutOfFlowPositioned" else where in the code but I think below one matches more closely:

https://github.com/WebKit/WebKit/blob/61a1009d68c4718583337288956333b630f6e904/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp#L104

____

Just wanted to share - Is it something still go to do or it can be ignored? Thanks!
Comment 2 Ahmad Saleem 2023-07-06 14:45:25 PDT
Created attachment 466959 [details]
GitHub Desktop

This compiles and work but I think we might need AB testing to look into performance and memory benefits on this bit.

Anyone interested to do those bits on Apple side?