inducer / inducer/pytato

Rejecting `__eq__` early if hashes disagree

Open
#168 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
15
Forks
16
Avg merge
17m
Merged PRs (30d)
1

Description

I'm not sure it's profitable for us, but it might be worth studying. The main reason I have doubts is because `freeze`s on equivalent computation lead to frequent graphs that *do* compare equal, meaning there's no benefit to an early exit that won't be taken. (And, if we were to compute the hash for this, there would be potentially substantial extra cost.)

Another option would be to
- make the hash value cache an attribute (e.g. `self._hash_value`) instead of implicit (via `@memoize_method`) and
- only use it for early exit if it's already computed (i.e. not `None`)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.