Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimizations for GoogleEventSet, speeding up merging 20+% #68

Merged
merged 1 commit into from
Sep 12, 2024

Commits on Sep 12, 2024

  1. optimizations for GoogleEventSet, speeding up merging 20+%

    - 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
    karlicoss committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    8fbc544 View commit details
    Browse the repository at this point in the history