mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
LibWeb: Don't allocate a new HeapFunction 60 times per second
We can reuse the same HeapFunction when queueing up a rendering task on the HTML event loop. No need to create extra work for the garbage collector like this.
This commit is contained in:
committed by
Andreas Kling
parent
1b127ac082
commit
5c6b879715
Notes:
github-actions[bot]
2024-10-25 08:22:14 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/5c6b8797159 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1956 Reviewed-by: https://github.com/gmta ✅
@@ -81,6 +81,8 @@ private:
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
void update_the_rendering();
|
||||
|
||||
Type m_type { Type::Window };
|
||||
|
||||
JS::GCPtr<TaskQueue> m_task_queue;
|
||||
@@ -116,6 +118,8 @@ private:
|
||||
bool m_skip_event_loop_processing_steps { false };
|
||||
|
||||
bool m_is_running_rendering_task { false };
|
||||
|
||||
JS::GCPtr<JS::HeapFunction<void()>> m_rendering_task_function;
|
||||
};
|
||||
|
||||
EventLoop& main_thread_event_loop();
|
||||
|
||||
Reference in New Issue
Block a user