Does Vec<Option<T>> hurt CPU cache locality?

84 points mammon-of-lilith

I'm writing an entity component system in Rust, and one of the main benefits of sparse ECSs like what I'm building is supposed to be that components are stored one after another contiguously in memory. However, not every entity needs every component, so I made it a vector of optional components instead of a vector of components, and now I'm wondering if that's going to be a problem, because isn't Option a pointer type? That would destroy all the cache locality benefits.