DescriptionRefactor histogram_persistence to be a class.
The number of top-level functions was getting too large
and impeding development of other features due to the
previous lack of OO design.
The code is largely unchanged, just moved into a stateful
class and reordered to match the public/private sections
of the class.
Two other CLs are included here because they fit well with the refactoring:
https://codereview.chromium.org/1689833002/
Add ownership-transfer to histogram management calls.
This CL changes the interface to use scoped_ptr to
explicitly document, with std::move, when the transfer
of ownership is taking place.
https://codereview.chromium.org/1731453002/
Reduce histogram creation time by avoiding import of those just created.
Attempting to import histograms in the persistent memory
segment is necessary because it could be shared and thus
have other processes creating objects within it. However,
there's no need to import those objects that this process
created.
The simple method remembering the "reference" of the last
histogram created in the allocator catches almost all
cases and reduces histogram creation time by 40%.
BUG=546019
TBR=grt,thakis
grt: setup/installer_metrics.cc (no logic changes)
thakis: gn & gyp changes for new files
Committed: https://crrev.com/33d95806addac4c84a88eb8561ea424ef2097b6d
Cr-Commit-Position: refs/heads/master@{#381386}
Patch Set 1 #Patch Set 2 : removed unnecessary qualifiers in header file; some 'git cl format' changes #Patch Set 3 : refactored (again) into PersistentHistogramAllocator class #
Total comments: 7
Patch Set 4 : addressed review comments by Alexi and temporarily re-order methods for easier review #
Total comments: 11
Patch Set 5 : addressed review comments by Alexei #Patch Set 6 : create helper methods for creating global histogram allocators #
Total comments: 20
Patch Set 7 : addressed review comments by Alexei #Patch Set 8 : move some parameters up a line #
Total comments: 8
Patch Set 9 : addressed review comments by Alexei #
Total comments: 13
Patch Set 10 : addressed final review comments by Alexei #
Messages
Total messages: 35 (15 generated)
|