Space-optimize the JSON output of times in milliseconds
Categories
(Core :: Gecko Profiler, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox93 | --- | fixed |
People
(Reporter: mozbugz, Assigned: mozbugz)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
One of the ideas from bug 1726675:
- Unneeded precision. These numbers being relative times (in milliseconds), a precision better than nanoseconds (fast processors may fit 3-4 cycles per nanosecond) is probably wasted space. So we could already round the above numbers to 361.655600, 363.035000, 0.166667.
And it would be easy to remove the trailing zeroes as well.
Eventually we will probably move to integer number of nanoseconds, but for now this is a quick win with little effort, and it doesn't require any changes on the front-end.
Bonus: It will separate the time-related outputs functions, so it will also help with future changes to times.
Assignee | ||
Comment 1•3 years ago
|
||
Instead of blindly outputting floating-point numbers of milliseconds, which leads to things like 363.03499999999997, times in ms are now converted to integer number of nanoseconds, stringified, and then manually adjusted to milliseconds again, so we get smaller and friendlier outputs like 363.035.
Eventually, bug 1726675 may change all times to integer number of nanoseconds anyway, but this patch is already helpful in reducing the output, and paves the way by separating the time-output functions from other number outputs.
Comment 2•3 years ago
|
||
bugherder |
Description
•