Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d3e922b38c77506b7fd4c965535a9fc6456041aa
      
https://github.com/WebKit/WebKit/commit/d3e922b38c77506b7fd4c965535a9fc6456041aa
  Author: Sammy Gill <[email protected]>
  Date:   2025-05-13 (Tue, 13 May 2025)

  Changed paths:
    M Source/WebCore/rendering/RenderFlexibleBox.cpp
    M Source/WebCore/rendering/RenderFlexibleBox.h

  Log Message:
  -----------
  [Flex] Use inline capacity for FlexLayoutItems and FlexLineStates.
https://bugs.webkit.org/show_bug.cgi?id=292874
rdar://151159201

Reviewed by Alan Baradlay.

Flex layout is a fairly hot codepath as it appears on traces of
benchmarks. There are two main Vectors that are used during flex layout:
FlexLayoutItems and FlexLineStates which are ephemeral and used to
hold onto flex items and various bits of state. When looking at traces
we can see a fair amount of samples related to increases in capacity for
these Vectors.

We recently sprinkled some inline capacity to certain other Vectors in
flex layout so I am building upon that and adding the same to these.

I chose four as the inline capacity for FlexLayoutItems to match the same
value we chose in the previous patch. I opted to change the existing
inline capacity of FlexItemFrameRects to match as it seems like the
value that was chosen in 122238@main was in response to review feedback
and there was not really any indication anywhere that is was based on
looking at existing web content or benchmarks, which is where our new
value comes from.

I chose two as the inline capacity for FlexLineStates by logging the
number of flex lines when performing basic browsing on various pages. It
turns out that one is the most common number of flex lines based on my
web surfing. However, I ended up choosing two for this since this
appears on benchmarks fairly frequently and is so close to the value
I observed on the web.

With this patch I no longer see any samples related to Vector capacity
in flex layout. FlexLayoutItem needed to move into the header in order
to use inline capacity for FlexLayoutItems.

Canonical link: https://commits.webkit.org/294847@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to