-
Notifications
You must be signed in to change notification settings - Fork 644
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
The current implementation of AlgebraicValue is #[derive(Hash)].
This causes the hash function to hash like so for e.g., AlgebraicValue::U16(x) to be:
hasher.write_u8(8); // The discriminant of `AlgebraicValue::U16` is 8.
hasher.write_u16(x); // The actual value `x: u16` in `::U16`.Instead, based on my discussion with @gefjon, we agreed that, we should only hash each AV's payload and not the tag/discriminant of the AV variant itself. The benefits include:
- This weakening should be more performant because its less work.
- This is what the hash function for
RowRefalready does. - It's easier to define a hash function for BSATN-encoded rows this way.
The weakening should not introduce more collisions because AVs in e.g., subscriptions follow a schema, so when you have 100 ::U8s, it does not reduce the rate of collisions when you hash the tag of U8.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request