[LayoutNG] Avoid creating NGPhysicalTextFragment::RareData
I am trying to figure out why laying out a large table takes up twice as much memory in NG. My test case is a 100K cells table (attached to bug). When profiling, I've noticed that NGPhysicalTextFragment had rare data 96340 times. NGPaintFragment NGInkOverflowModel was being created 88360 times This patch is my attempt to improve this. With the patch: NGPhysicalTextFragment rare data is down to 82084 NGInkOverflowModel is down to 74080 The reason RareData was being created was that ink_overflow.ExpandEdgesToPixelBoundaries() local_ink_overflow = ConvertToLocal(ink_overflow) local_rect.Contains(local_ink_overflow) was false whenever ink_overflow was fractional (because it expanded). Expanding edges only if local_rect does not contain local_ink_overflow without expansion reduced the number of RareData created > 15%. There is another problem with ascents/location that causes more cache misses. I'll need @kojii's help with it. Bug: 931663 Change-Id: I586ca26024338a97263f9d324d62a4a50d53895a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1535294 Commit-Queue: Aleks Totic <atotic@chromium.org> Reviewed-by:Emil A Eklund <eae@chromium.org> Reviewed-by:
Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#649745}
Showing
Please register or sign in to comment