Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Move digest path calculation out of loop #33821
On every iteration of generating a cache for a collection a “digest path” is calculated even though it’s exactly the same for every element.
This PR exposes a method
before: Total allocated: 762539 bytes (7035 objects)
(762539 - 743590)/ 762539.0 # => 2.4% faster
I'm confused about the presented statistic: Total allocation for after is larger than for before - so wouldn't it use more memory despite allocating less objects?
Also, how do you get a speed increase from multiplying and dividing bytes allocated? They way I'm reading it, it isn't 2.4% faster - it's allocating 2.4% more memory.
What am I missing?
Correct I flipped the bytes when making the PR.
I just re-ran the calculation and this is what I get