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

Optimize alter #404

Merged
merged 4 commits into from May 10, 2022
Merged

Optimize alter #404

merged 4 commits into from May 10, 2022

Conversation

sjakobi
Copy link
Member

@sjakobi sjakobi commented Apr 3, 2022

Fixes #392.

@sjakobi
Copy link
Member Author

sjakobi commented Apr 3, 2022

The benchmark results are largely good, but some are too noisy, particularly HashMap.insert (elided).

master:

    alterInsert-dup
      String:     OK (2.54s)
        583  μs ± 4.6 μs
      ByteString: OK (2.41s)
        275  μs ± 1.9 μs
      Int:        OK (4.01s)
        470  μs ± 1.8 μs
    alterDelete
      String:     OK (3.56s)
        833  μs ± 3.1 μs
      ByteString: OK (2.92s)
        674  μs ± 3.5 μs
      Int:        OK (3.95s)
        463  μs ± 1.4 μs
    alterDelete-miss
      String:     OK (1.87s)
        211  μs ± 1.6 μs
      ByteString: OK (2.50s)
        141  μs ± 1.1 μs
      Int:        OK (2.29s)
        259  μs ± 1.7 μs

This branch (1059d3c):

    alterInsert-dup
      String:     OK (2.14s)
        491  μs ± 3.5 μs
      ByteString: OK (2.33s)
        265  μs ± 1.5 μs
      Int:        OK (6.29s)
        373  μs ± 1.1 μs
    alterDelete
      String:     OK (1.86s)
        838  μs ± 6.5 μs
      ByteString: OK (2.76s)
        636  μs ± 2.7 μs
      Int:        OK (2.02s)
        454  μs ± 2.8 μs
    alterDelete-miss
      String:     OK (2.00s)
        225  μs ± 1.5 μs
      ByteString: OK (2.04s)
        114  μs ± 780 ns
      Int:        OK (2.20s)
        248  μs ± 1.4 μs

@sjakobi sjakobi marked this pull request as ready for review May 7, 2022 13:31
@sjakobi sjakobi requested a review from treeowl May 7, 2022 13:31
@sjakobi sjakobi merged commit 455ad49 into master May 10, 2022
@sjakobi sjakobi deleted the sjakobi/392-faster-alter branch May 10, 2022 01:37
@treeowl
Copy link
Collaborator

treeowl commented May 10, 2022

Oops! Missed your review request. I'll try to look at it later.

@treeowl
Copy link
Collaborator

treeowl commented May 10, 2022

Why doesn't this just do one pass? We can use manual worker-wrapper to try to unbox the Maybes going in and out of the passed function.

@sjakobi
Copy link
Member Author

sjakobi commented May 10, 2022

Why doesn't this just do one pass? We can use manual worker-wrapper to try to unbox the Maybes going in and out of the passed function.

Makes sense. See #392 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

alter could be much more efficient
2 participants