Update buffer capacity display to MiB #5503
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improve "Buffer Capacity" display, e.g. "8.00MB" -> "8 MiB" #2533
E.g., for a `profile.meta.configuration.capacity" of 8388608 (which is 8 * 1024 * 1024), the displayed "Profile Information" -> "Buffer Capacity" is "8.00MB".
In my opinion:
The '.00' should be removed.
The unit should be "MiB", to clarify that they are IEC "Mebibytes" (2^20 or 1024^2) and not strict SI "Megabytes" (10^6 or 1000^2). See https://en.wikipedia.org/wiki/Mebibyte
I think a space would help with reading.
So the capacity in this case should be displayed as "8 MiB".
Note that starting with https://bugzilla.mozilla.org/show_bug.cgi?id=1634234 , the profiler will only use exact powers of 2 as "Buffer Capacity", so in most new profiles we should get nice "round" numbers of MiBs. (However we may remove the power-of-2 restriction one day, but I hope we'll keep round numbers of MiBs nonetheless.)
┆Issue is synchronized with this Jira Task