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

Added Transactional Gatherer allowed cached solutions #989

Merged
merged 13 commits into from Feb 23, 2022
Merged

Commits on Jan 25, 2022

  1. Added cached collector.

    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    
    update.
    
    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    
    Attempt 2
    
    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    
    Added blocking registry, with raw collector and transactional handler.
    
    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    
    Added fast path to normal (empty) registry to save 8 allocs and 3K5B per Gather.
    
    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    
    Simplified API, added tests.
    
    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    
    Fix.
    
    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    
    Simplified implementation.
    
    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    
    Added benchmark.
    
    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    
    Optimized.
    
    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    bwplotka committed Jan 25, 2022
    Copy the full SHA
    a1c9be4 View commit details
    Browse the repository at this point in the history
  2. Optimization attempt.

    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    bwplotka committed Jan 25, 2022
    Copy the full SHA
    2fcaf51 View commit details
    Browse the repository at this point in the history
  3. Revert "Optimization attempt."

    This reverts commit 2fcaf51.
    
    Optimization was not worth it:
    
     benchstat v1.txt v2.txt
    name                                                           old time/op    new time/op    delta
    CachedTGatherer_Update/Update_of_one_element_without_reset-12    2.64µs ± 0%    4.05µs ± 0%   ~     (p=1.000 n=1+1)
    CachedTGatherer_Update/Update_of_all_elements_with_reset-12       701ms ± 0%     358ms ± 0%   ~     (p=1.000 n=1+1)
    CachedTGatherer_Update/Gather-12                                  535µs ± 0%  703934µs ± 0%   ~     (p=1.000 n=1+1)
    
    name                                                           old alloc/op   new alloc/op   delta
    CachedTGatherer_Update/Update_of_one_element_without_reset-12      208B ± 0%      208B ± 0%   ~     (all equal)
    CachedTGatherer_Update/Update_of_all_elements_with_reset-12      40.2MB ± 0%    41.1MB ± 0%   ~     (p=1.000 n=1+1)
    CachedTGatherer_Update/Gather-12                                 48.6kB ± 0%    84.3kB ± 0%   ~     (p=1.000 n=1+1)
    
    name                                                           old allocs/op  new allocs/op  delta
    CachedTGatherer_Update/Update_of_one_element_without_reset-12      3.00 ± 0%      3.00 ± 0%   ~     (all equal)
    CachedTGatherer_Update/Update_of_all_elements_with_reset-12        6.00 ± 0%   4003.00 ± 0%   ~     (p=1.000 n=1+1)
    CachedTGatherer_Update/Gather-12                                  1.00k ± 0%     2.01k ± 0%   ~     (p=1.000 n=1+1)
    bwplotka committed Jan 25, 2022
    Copy the full SHA
    10f1d94 View commit details
    Browse the repository at this point in the history
  4. nit.

    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    bwplotka committed Jan 25, 2022
    Copy the full SHA
    273cb92 View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2022

  1. Another optimization attempt.

    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    bwplotka committed Jan 26, 2022
    Copy the full SHA
    870e237 View commit details
    Browse the repository at this point in the history
  2. rename and further optimization.

    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    bwplotka committed Jan 26, 2022
    Copy the full SHA
    11bdfa3 View commit details
    Browse the repository at this point in the history
  3. Hopefully final optimization.

    benchstat -delta-test=none v6.txt v9.txt
    name                                                           old time/op    new time/op    delta
    CachedTGatherer_Update/Update_of_one_element_without_reset-12    13.1ms ± 0%     0.0ms ± 0%  -99.81%
    CachedTGatherer_Update/Update_of_all_elements_with_reset-12       309ms ± 0%     282ms ± 0%   -8.77%
    CachedTGatherer_Update/Gather-12                                  422ms ± 0%       0ms ± 0%  -99.95%
    
    name                                                           old alloc/op   new alloc/op   delta
    CachedTGatherer_Update/Update_of_one_element_without_reset-12      208B ± 0%      208B ± 0%    0.00%
    CachedTGatherer_Update/Update_of_all_elements_with_reset-12      2.47kB ± 0%    1.67kB ± 0%  -32.56%
    CachedTGatherer_Update/Gather-12                                 52.8kB ± 0%    24.6kB ± 0%  -53.34%
    
    name                                                           old allocs/op  new allocs/op  delta
    CachedTGatherer_Update/Update_of_one_element_without_reset-12      3.00 ± 0%      3.00 ± 0%    0.00%
    CachedTGatherer_Update/Update_of_all_elements_with_reset-12        0.00           0.00         0.00%
    CachedTGatherer_Update/Gather-12                                  1.00k ± 0%     0.00k ± 0%  -99.60%
    
    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    bwplotka committed Jan 26, 2022
    Copy the full SHA
    961f8ca View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2022

  1. Removed obsolete comment

    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    bwplotka committed Feb 17, 2022
    Copy the full SHA
    8bbbe7a View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2022

  1. Fixed tests.

    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    bwplotka committed Feb 23, 2022
    Copy the full SHA
    8caf328 View commit details
    Browse the repository at this point in the history
  2. Removed cache.

    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    bwplotka committed Feb 23, 2022
    Copy the full SHA
    81d86fb View commit details
    Browse the repository at this point in the history
  3. Fixed tests.

    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    bwplotka committed Feb 23, 2022
    Copy the full SHA
    cba52a7 View commit details
    Browse the repository at this point in the history
  4. Re-add cache.

    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    bwplotka committed Feb 23, 2022
    Copy the full SHA
    29c7671 View commit details
    Browse the repository at this point in the history
  5. Removed cache.

    Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
    bwplotka committed Feb 23, 2022
    Copy the full SHA
    c4563c4 View commit details
    Browse the repository at this point in the history