The first one is handled reliably using first argument indexing. The second should be handled using the JIT indexing, but this only triggers if there are sufficient clauses (I think >= 16 by default). In theory it should make a “deep index” on (-)/2 and then it might make a multi-argument index on the first two arguments (depending on the value distribution). This results in a combined hash that can be subject to hash collisions and determinism is thus not guaranteed.