Closed
Bug 1485313
Opened 6 years ago
Closed 6 years ago
The HistogramInfo structure could be compacted
Categories
(Toolkit :: Telemetry, enhancement, P1)
Toolkit
Telemetry
Tracking
()
RESOLVED
FIXED
mozilla64
Tracking | Status | |
---|---|---|
firefox64 | --- | fixed |
People
(Reporter: adrian17, Assigned: janerik)
References
Details
Attachments
(1 file)
This is the current definition of HistogramInfo: https://searchfox.org/mozilla-central/source/toolkit/components/telemetry/TelemetryHistogram.cpp#131 struct HistogramInfo { uint32_t min; uint32_t max; uint32_t bucketCount; uint32_t histogramType; uint32_t name_offset; uint32_t expiration_offset; uint32_t dataset; uint32_t label_index; uint32_t label_count; uint32_t key_index; uint32_t key_count; RecordedProcessType record_in_processes; // enum : uint32_t bool keyed; SupportedProduct products; // enum : uint32_t }; In x64, it takes 56 bytes. The array gHistogramInfos holds around 1800 entries - that's around 100kB in total. In fact, it seems to be the biggest single object reported by readelf on my libxul build. Of these, it seems like some fields are bigger than necessary: - the enums RecordedProcessType and SupportedProduct could probably fit in uint8_t, - histogramType seems to be an enum with 6 values, so it could also fit in uint8_t, - dataset seems to have only two possible values (optin/optout), - label_index, key_index are indices into arrays with less than 2**16 elements. With reducing the field size and some reordering it should be possible to reduce the gHistogramInfos array by 20kB or more.
Assignee | ||
Updated•6 years ago
|
Priority: -- → P3
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → jrediger
Priority: P3 → P1
QA Contact: gfritzsche
Assignee | ||
Comment 1•6 years ago
|
||
I have no idea how I managed to put in a QA contact there, but I'm also not able to remove it again. Sorry about that.
Assignee | ||
Comment 2•6 years ago
|
||
This reduces the size of a HistogramInfo instance from 56 byte down to 40 bytes. At currently ~1770 histogram that saves a total of 28,000 byte of static data.
Updated•6 years ago
|
QA Contact: gfritzsche
Pushed by jrediger@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/705896b42137 Compact HistogramInfo structure r=Dexter
Comment 4•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/705896b42137
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in
before you can comment on or make changes to this bug.
Description
•