Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimizations for GoogleEventSet, speeding up merging 20+% (#68)
- add `add_if_not_present` method to avoid computing key twice (which is quite expensive!) This is intended to be used as a replacement for (e.g. in HPI) ``` if event in emitted: continue emitted.add(event) yield event ``` With this method, we could rewrite as: ``` if emitted.add_if_not_present(event): yield event ``` This could be introduced to hpi with backwards compatibility. - use type directly as key, types are hashable (very tiny speedup, but it also feels more natural anyway
- Loading branch information