mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
LibWeb: Defer invalidation sets processing until update_style()
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
This change converts `Node::invalidate_style()` (invalidation sets overload) from eagerly doing tree traversal that marks elements affected by invalidation set to instead adding "pending invalidation sets" into `StyleInvalidator`, processing of which is deferred until the next `update_style()`. By doing that we sometimes substantially reduce amount of work done performing tree traversal that marks elements for style recalculation. Improves performance on Discord, were according to my measurements we were previously spending 20% of time in style invalidation, but now it's down to <1%.
This commit is contained in:
parent
8cbe27b2f9
commit
b0ef7f4427
Notes:
github-actions[bot]
2025-07-16 22:44:27 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: b0ef7f4427
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5474
6 changed files with 82 additions and 18 deletions
|
@ -903,6 +903,8 @@ public:
|
|||
|
||||
String dump_display_list();
|
||||
|
||||
StyleInvalidator& style_invalidator() { return m_style_invalidator; }
|
||||
|
||||
protected:
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue