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

Add hashset (new hash table) and use in command lookup #1186

Open
wants to merge 11 commits into
base: unstable
Choose a base branch
from

Commits on Oct 17, 2024

  1. Hashset implementation (squashed)

    Signed-off-by: Viktor Söderqvist <[email protected]>
    zuiderkwast committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    02221d1 View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2024

  1. Replace dict with hashset in command tables (#1065)

    This changes the type of command tables from dict to hashset. Command
    table lookup takes ~3% of overall CPU time in benchmarks, so it is a
    good candidate for optimization.
    
    My initial SET benchmark comparison suggests that hashset is about 4.5
    times faster than dict and this replacement reduced overall CPU time by
    2.79% 🥳
    
    ---------
    
    Signed-off-by: Rain Valentine <[email protected]>
    Signed-off-by: Rain Valentine <[email protected]>
    Co-authored-by: Rain Valentine <[email protected]>
    2 people authored and zuiderkwast committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    3038293 View commit details
    Browse the repository at this point in the history
  2. Iterator bugfixes: handle empty hashset and change iteration order so…

    … rehashed buckets can be skipped (#1147)
    
    Fixes 2 bugs in hashsetNext():
    
    - null dereference when iterating over new unused hashset
    - change order of iteration so skipping past already-rehashed buckets
    works correctly and won't miss elements
    
    Minor optimization in hashsetScan and some renamed variables.
    
    Signed-off-by: Rain Valentine <[email protected]>
    SoftlyRaining authored Oct 18, 2024
    Configuration menu
    Copy the full SHA
    bfbf5b0 View commit details
    Browse the repository at this point in the history
  3. Apply suggestions from code review

    Co-authored-by: Madelyn Olson <[email protected]>
    Signed-off-by: Viktor Söderqvist <[email protected]>
    zuiderkwast and madolson authored Oct 18, 2024
    Configuration menu
    Copy the full SHA
    a7f34b8 View commit details
    Browse the repository at this point in the history
  4. More code review suggestions

    Use variable name `s` for hashset instead of `t`.
    
    Use variable name `element` instead of `elem`.
    
    Remove the hashsetType.userdata field.
    
    Some more fixes.
    
    Signed-off-by: Viktor Söderqvist <[email protected]>
    zuiderkwast committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    69ec76a View commit details
    Browse the repository at this point in the history
  5. Fix comment and delete unused code

    Signed-off-by: Viktor Söderqvist <[email protected]>
    zuiderkwast committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    bd1ecfb View commit details
    Browse the repository at this point in the history
  6. Mistake in previous incomplete variable renaming

    Signed-off-by: Viktor Söderqvist <[email protected]>
    zuiderkwast committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    10d3abf View commit details
    Browse the repository at this point in the history
  7. Fix trailing whitespace in comment

    Signed-off-by: Viktor Söderqvist <[email protected]>
    zuiderkwast committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    2204dd6 View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2024

  1. Fix more review comments

    Signed-off-by: Viktor Söderqvist <[email protected]>
    zuiderkwast committed Oct 20, 2024
    Configuration menu
    Copy the full SHA
    5eb3e17 View commit details
    Browse the repository at this point in the history
  2. Use snake_case for struct fields + make stats struct opaque

    Signed-off-by: Viktor Söderqvist <[email protected]>
    zuiderkwast committed Oct 20, 2024
    Configuration menu
    Copy the full SHA
    b5f61df View commit details
    Browse the repository at this point in the history
  3. Fixup: test case reference to renamed field

    Signed-off-by: Viktor Söderqvist <[email protected]>
    zuiderkwast committed Oct 20, 2024
    Configuration menu
    Copy the full SHA
    5129254 View commit details
    Browse the repository at this point in the history