mirror of
https://github.com/servo/servo
synced 2026-05-10 17:12:23 +02:00
This function showed up as a top producer of allocations (around 10% of all allocations). Allocating the vector once upfront and using `collect_into_vec` removes any intermediate allocations. This approach is also recommended by the rayon documentation: https://docs.rs/rayon/1.10.0/rayon/iter/trait.ParallelIterator.html#method.collect Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>