Most files are going to be looked up into a set or dictionary. Precompute the hash so that we only need to do so once and we can also use it to quickly weed out unequal objects. On a QEMU build, the time spent in __eq__ and __hash goes respectively from 3.110s to 2.162s and from 0.648s to 0.299s. Even larger gains are obtained by the next patch.pull/7607/head
parent
3d4fb02e29
commit
372f420778
1 changed files with 4 additions and 1 deletions
Loading…
Reference in new issue