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

Performance improvements for IdDict #51091

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Commits on Feb 2, 2024

  1. Performance improvements for IdDict

    Remove old comment
    
    Switch to atomic pointers
    
    Fixes errors in ASAN as previously we did atomic stores to non atomic pointers
    
    Split empty! change into seperate pr
    
    Remove duplication in C code
    
    Add tests
    
    15% speed up for setindex!
    
    Remove try catch
    
    Signifcant performance improvement for path where error used to be caught.
    
    Fix bug
    
    Actually fix bug
    
    Restore performance by not boxing key twice
    
    Fix comment
    
    Add comment about IdDict being mirrored in julia.h
    
    Fix comment
    
    Fix another comment
    
    Allow writing NULL into iddict
    
    Reverts the change of behaviour just in case.
    
    Remove clutter
    Zentrik committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    717388b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    27dcc24 View commit details
    Browse the repository at this point in the history
  3. Move code for calculating key index into Julia

    Added inbounds as dict.jl seems to use them as well
    Zentrik committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    a31404b View commit details
    Browse the repository at this point in the history
  4. Decrease inlining cost of key indexing function

    Unfortunately, cost is ~106 now so still too high, JuliaLang#51912 is tracking issue about high cost.
    
    Lowers inlining cost of setproperty as we know rhs isa Memory{Any}
    Zentrik committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    d5fba6f View commit details
    Browse the repository at this point in the history
  5. Force inlining

    About 15% faster on microbenchmark, `f!(d)` example in pr comments
    Zentrik committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    d17b27b View commit details
    Browse the repository at this point in the history
  6. Revert "Force inlining"

    This reverts commit 7eb2ed6.
    Zentrik committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    bb360d6 View commit details
    Browse the repository at this point in the history
  7. Revert "Decrease inlining cost of key indexing function"

    This reverts commit 519dfe7.
    Zentrik committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    f377b7e View commit details
    Browse the repository at this point in the history
  8. Revert "Move code for calculating key index into Julia"

    This reverts commit 7f20833.
    Zentrik committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    e34913a View commit details
    Browse the repository at this point in the history
  9. Add inbounds back in

    Added inbounds as dict.jl seems to use them as well
    Zentrik committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    46daa2d View commit details
    Browse the repository at this point in the history
  10. Revert changes to get! with callable and add test.

    Fixes bug if for example the call to `default` mutated the dict.
    Zentrik committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    cd5f495 View commit details
    Browse the repository at this point in the history
  11. Add trailing new line

    Zentrik committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    ad5a02a View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    c3047c1 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    3a428ad View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2024

  1. Conform to dict API and deal with convert failing

    Conform to dict API, by moving `@inbounds` and changing `ht_keyindex!`.
    Deal with failure case when `convert` calls fails.
    
    TODO: think about concurrent modifications, should only be a problem in `get!`. Add tests for `convert` failing.
    Zentrik committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    25e7410 View commit details
    Browse the repository at this point in the history
  2. Fix bug in writing to dict

    Zentrik committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    6cbd3f0 View commit details
    Browse the repository at this point in the history
  3. Don't delete key

    Caused segfaults when ht_keyindex2! caused a rehash
    Zentrik committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    e864462 View commit details
    Browse the repository at this point in the history