Update a comment.

I did some measurements. The current choice of 16 is fine.
This commit is contained in:
Nicholas Nethercote 2026-01-07 15:05:53 +11:00
parent e4bbfe8856
commit eb1645653b

View file

@ -244,8 +244,9 @@ impl<'a, D: SolverDelegate<Interner = I>, I: Interner> Canonicalizer<'a, D, I> {
arg: impl Into<I::GenericArg>,
kind: CanonicalVarKind<I>,
) -> ty::BoundVar {
// FIXME: 16 is made up and arbitrary. We should look at some
// perf data here.
// The exact value of 16 here doesn't matter that much (8 and 32 give extremely similar
// results). So long as we have protection against the rare cases where the length reaches
// 1000+ (e.g. `wg-grammar`).
let arg = arg.into();
let idx = if self.variables.len() > 16 {
if self.variable_lookup_table.is_empty() {