Practice
Learn
← Quit
0 / 0 correct
Rust
Hard
1 of 20
Why is `Vec<Box<dyn Trait>>` often slower than iterating separate Vec<A>, Vec<B> of concrete types?
A
Each element is a separate heap allocation reached through a pointer, and calls go through a vtable, hurting cache locality and inlining
B
dyn calls are 100× slower
C
Box is always slower than Vec
D
Trait objects can't be iterated