diff --git a/components/selectors/parser.rs b/components/selectors/parser.rs index 3aee478311c..22293688b3a 100644 --- a/components/selectors/parser.rs +++ b/components/selectors/parser.rs @@ -932,15 +932,11 @@ fn parse_selector(parser: &P, input: &mut CssParser) -> Result 8 entries, we save two reallocations. -type ParseVec = SmallVec<[Component; 8]>; +/// We make this large because the result of parsing a selector is fed into a new +/// Arc-ed allocation, so any spilled vec would be a wasted allocation. Also, +/// Components are large enough that we don't have much cache locality benefit +/// from reserving stack space for fewer of them. +type ParseVec = SmallVec<[Component; 32]>; /// Parses a complex selector, including any pseudo-element. ///