Currently associated-derive uses match to resolve which constant it should return. This is fine when used with enums with consecutive discriminants or non-consecutive but not too sparse as Rust will compile the match to a jump table (even in debug builds).
However if the discriminants are very sparse, it will fall back to checking one-by-one which is linear time complexity with the number of variants.
Having other resultion methods, like some sort of binary search or a precomputed static hash table, could be very useful in those circumstances. Before they can be built, the user needs a way to chose which method to use, currently just "Match".
Currently associated-derive uses match to resolve which constant it should return. This is fine when used with enums with consecutive discriminants or non-consecutive but not too sparse as Rust will compile the match to a jump table (even in debug builds).
However if the discriminants are very sparse, it will fall back to checking one-by-one which is linear time complexity with the number of variants.
Having other resultion methods, like some sort of binary search or a precomputed static hash table, could be very useful in those circumstances. Before they can be built, the user needs a way to chose which method to use, currently just "Match".