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

Feature/2005 large composite disposable perf #2092

Merged
merged 4 commits into from
Apr 29, 2024

Commits on Mar 8, 2024

  1. Configuration menu
    Copy the full SHA
    bac9955 View commit details
    Browse the repository at this point in the history
  2. Add large mode to CompositeDisposable

    Once the number of elements in a CompositeDisposable gets into the thousands, Remove became very expensive because it performed a linear search. This change causes CompositeDisposable to switch into an alternate mode using a dictionary to enable hash-based lookup once it grows over a particular size.
    
    With under 1024 elements, the behaviour is as before. The number of fields remains the same so this should not change the memory footprint of small CompositeDisposables. However, it does require it to check which of the two modes it is in, so there will likely be a small performance penalty for small CompositeDisposables, so we will need to see if this changes any benchmarks in a significant way before merging this change.
    idg10 committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    a8a141e View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2024

  1. Remove TODO about shrinking

    Not necessary with the dictionary. We did it for the list purely because we deliberately allowed the list to become peppered with nulls to avoid having to resize it on every call to Remove.
    idg10 committed Mar 12, 2024
    Configuration menu
    Copy the full SHA
    a6513ca View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2024

  1. Configuration menu
    Copy the full SHA
    b936c63 View commit details
    Browse the repository at this point in the history