mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01: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
|
|
@ -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…
Reference in New Issue
Block a user