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