mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00: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:
parent
eafa70331d
commit
26f32b11f9
Notes:
github-actions[bot]
2024-11-24 16:18:45 +00:00
Author: https://github.com/awesomekling
Commit: 26f32b11f9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2548
2 changed files with 23 additions and 17 deletions
|
@ -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 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue