[XLA:Python] Tiny optimization in traceback hashing.
It's slightly faster to define a tp_hash slot than a __hash__ method, notably because it saves a PyLong construction for the hash return value. While we're here tp_richcompare is slightly faster to dispatch than eq.
This isn't a particularly important optimization but I noticed it looking at a profile.
[XLA:Python] Tiny optimization in traceback hashing.
It's slightly faster to define a tp_hash slot than a
__hash__
method, notably because it saves a PyLong construction for the hash return value. While we're here tp_richcompare is slightly faster to dispatch than eq.This isn't a particularly important optimization but I noticed it looking at a profile.