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

reduce allocation by 15% #94

Merged
merged 1 commit into from
Sep 10, 2021
Merged

reduce allocation by 15% #94

merged 1 commit into from
Sep 10, 2021

Conversation

Moelf
Copy link
Member

@Moelf Moelf commented Sep 10, 2021

With the classical test:

julia> const t = LazyTree(ROOTFile("Run2012BC_DoubleMuParked_Muons.root"), "Events", ["Muon_pt"]);

julia> @benchmark let nmu=0
           for evt in t
               nmu += sum(evt.Muon_pt)
           end
           nmu
       end

Before:

BenchmarkTools.Trial: 1 sample with 1 evaluation.
 Single result which took 5.104 s (2.01% GC) to evaluate,
 with a memory estimate of 4.72 GiB, over 59724 allocations.

After:

BenchmarkTools.Trial: 2 samples with 1 evaluation.
 Range (min … max):  4.921 s …  4.931 s  ┊ GC (min … max): 1.24% … 1.29%
 Time  (median):     4.926 s             ┊ GC (median):    1.26%
 Time  (mean ± σ):   4.926 s ± 6.853 ms  ┊ GC (mean ± σ):  1.26% ± 0.04%

  █                                                      █  
  █▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█ ▁
  4.92 s        Histogram: frequency by time        4.93 s <

 Memory estimate: 4.16 GiB, allocs estimate: 58155.

@Moelf Moelf requested a review from aminnj September 10, 2021 11:56
@Moelf Moelf changed the title reduce allocation by few percentage reduce allocation by 10% Sep 10, 2021
@Moelf Moelf changed the title reduce allocation by 10% reduce allocation by 15% Sep 10, 2021
@codecov
Copy link

codecov bot commented Sep 10, 2021

Codecov Report

Merging #94 (efa6650) into master (00d661a) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
- Coverage   84.84%   84.83%   -0.02%     
==========================================
  Files          11       11              
  Lines        1320     1319       -1     
==========================================
- Hits         1120     1119       -1     
  Misses        200      200              
Impacted Files Coverage Δ
src/root.jl 90.86% <100.00%> (-0.05%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 00d661a...efa6650. Read the comment docs.

@Moelf Moelf merged commit 60986a5 into master Sep 10, 2021
@Moelf Moelf deleted the less_allocation_basket_data branch July 1, 2022 21:39
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.

1 participant