Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Substantial speedups for the __eq__ of EqHash.
Do this by unrolling the loop and generating code, eliminating all the conditionals as well. Before: Avg Base eq 0.762074232101 stddev 0.00893669830878 Avg Child eq 1.46989099185 stddev 0.0260021505811 Avg Super eq 0.776515642802 stddev 0.011819047442 Avg Super2 eq 0.2257057031 stddev 0.0025750486944 Avg many eq 1.56614136696 stddev 0.0195022584734 After: Avg Base eq 0.410983006159 stddev 0.00708241719015 Avg Child eq 0.903119166692 stddev 0.0051626944104 Avg Super eq 0.41703470548 stddev 0.00604558003878 Avg Super2 eq 0.208957354228 stddev 0.00508863378261 Avg many eq 0.797417243322 stddev 0.0198358058579
- Loading branch information
Showing
4 changed files
with
125 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e8fc0d2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good... getattr and the loop sure can be slow