Hashing is much less important to apollo-compiler as it was when we were using Salsa. Many of the structs stored in Node<_> don’t even implement Hash since they contain IndexMap which doesn’t.
We lose: potential CPU time if repeatedly hashing nodes. ast::Definition implements PartialEq and Hash by traversing the whole subtree, which can be expensive. We gain: 8 fewer bytes in the heap allocation of every Node, and slightly less code complexity.
Hashing is much less important to apollo-compiler as it was when we were using Salsa. Many of the structs stored in
Node<_>
don’t even implementHash
since they containIndexMap
which doesn’t.We lose: potential CPU time if repeatedly hashing nodes.
ast::Definition
implementsPartialEq
andHash
by traversing the whole subtree, which can be expensive. We gain: 8 fewer bytes in the heap allocation of everyNode
, and slightly less code complexity.