mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00
LibGC: Preallocate space before dumping GC graph
Speeds up the append_gc_graph function by preallocating space. This change reduces the time taken to dump the GC graph by 4% on about:blank.
This commit is contained in:
parent
160c15444b
commit
03ac6e6e87
Notes:
github-actions[bot]
2024-12-14 08:07:49 +00:00
Author: https://github.com/shlyakpavel
Commit: 03ac6e6e87
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2907
1 changed files with 1 additions and 0 deletions
|
@ -119,6 +119,7 @@ public:
|
|||
m_all_live_heap_blocks.set(&block);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
m_work_queue.ensure_capacity(roots.size());
|
||||
|
||||
for (auto& [root, root_origin] : roots) {
|
||||
auto& graph_node = m_graph.ensure(bit_cast<FlatPtr>(root));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue