mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
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:
parent
12c6ac78e2
commit
73a4b176cf
Notes:
github-actions[bot]
2025-03-08 11:10:16 +00:00
Author: https://github.com/awesomekling
Commit: 73a4b176cf
13 changed files with 102 additions and 108 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue