Revert "LibWeb: Cache intrinsic sizes across layout runs"

This reverts commit 12c6ac78e2.

Very large performance regression when viewing GitHub repository pages.
This commit is contained in:
Andreas Kling 2025-03-08 12:08:51 +01:00
commit 73a4b176cf
Notes: github-actions[bot] 2025-03-08 11:10:16 +00:00
13 changed files with 102 additions and 108 deletions

View file

@ -221,6 +221,18 @@ struct LayoutState {
HashMap<GC::Ref<Layout::Node const>, NonnullOwnPtr<UsedValues>> used_values_per_layout_node;
// We cache intrinsic sizes once determined, as they will not change over the course of a full layout.
// This avoids computing them several times while performing flex layout.
struct IntrinsicSizes {
Optional<CSSPixels> min_content_width;
Optional<CSSPixels> max_content_width;
HashMap<CSSPixels, Optional<CSSPixels>> min_content_height;
HashMap<CSSPixels, Optional<CSSPixels>> max_content_height;
};
HashMap<GC::Ptr<NodeWithStyle const>, NonnullOwnPtr<IntrinsicSizes>> mutable intrinsic_sizes;
LayoutState const* m_parent { nullptr };
LayoutState const& m_root;