mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibWeb: Avoid expensive Vector filtering in event loop
Instead of collecting all documents in a big vector and then filtering the vector (twice!) with remove_all_matching(), we now pass a filter callback to documents_in_this_event_loop_matching() and avoid all the extra shuffling work. Saw this stuff hogging ~20% of CPU time when profiling a WebContent process in the middle of a WPT run.
This commit is contained in:
committed by
Andreas Kling
parent
eafa70331d
commit
26f32b11f9
Notes:
github-actions[bot]
2024-11-24 16:18:45 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/26f32b11f96 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2548
@@ -95,6 +95,8 @@ private:
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
[[nodiscard]] Vector<GC::Root<DOM::Document>> documents_in_this_event_loop_matching(auto callback) const;
|
||||
|
||||
void update_the_rendering();
|
||||
|
||||
Type m_type { Type::Window };
|
||||
|
||||
Reference in New Issue
Block a user