-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed up equality; remove expensive invariant
We used to define `==` to test equality in *priority* order. This was expensive in and of itself, since it takes logarithmic time to produce each entry. But the situation was worse than that: since priorities are not unique, we introduced an extra invariant to make sure that keys with the same priority are extracted in key order. This requires additional comparisons in various performance-critical functions. * Remove the extra invariant. * Remove the extra code to preserve it. * Change `(==)` to work in key order instead of priority order. Keys are unique, so this is very natural. * Remove a bunch of now-redundant constraints. * Document the nondeterminism.
- Loading branch information
Showing
1 changed file
with
42 additions
and
56 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