mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 04:37:55 +00: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:
committed by
Alexander Kalenik
parent
160c15444b
commit
03ac6e6e87
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user