New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disambiguate memory units in favor of IEC names #136
Comments
Please please please don't do that. It's just needlessly pedantic. Just accept that on computers MB means 2^20 and so on. |
Not everyone does accept that, and when I read a pprof profile I have no idea which sort of person the author is. Saying KiB makes it absolutely clear. |
@aalexand Also, should I file a separate issue for needing larger units (TiB and PiB) or is that worth dealing with in one fell swoop? |
Please file a separate bug for the larger units.
…On Thu, Apr 27, 2017 at 8:35 AM, ahh ***@***.***> wrote:
@aalexand <https://github.com/aalexand> Also, should I file a separate
issue for needing larger units (TiB and PiB) or is that worth dealing with
in one fell swoop?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#136 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABctwNHnnuVUShQf4_AlxKKgXQuDjBYDks5r0LW4gaJpZM4NJzhg>
.
|
I filed this request at ahh@'s ask to discuss it. In practice there isn't a lot of ambiguity about MB / GB for memory units - assuming powers of 2 are used is a safe bet. E.g. That said, the clarity becomes more important when a profile represents larger amounts of memory as at TB vs. TiB the difference becomes ~10%. |
How about if we leave the current defaults as-is (as broken as they can pedantically be considered), but we support users specifying IEC units on the command line (eg -unit=GiB or even perhaps even -unit=IEC)? Would that please/appease/at least not annoy everyone? |
This fixes google#137 (but not google#136, this will come separately once we decide what we want to do if anything).
Closing this due to lack of interest. Reopen if you care about it. |
* Add support for terabyte and petabyte memory units. This fixes google#137 (but not google#136, this will come separately once we decide what we want to do if anything). * Add a test. * Update copyright year
On reports, pprof uses B/kB/MB/GB to represent 1/2^10/2^20/2^30, which as at least one user pointed out is ambiguous at best. We should probably remap these to B/KiB/MiB/GiB, which should be more accurate. The only compat concerns would be for people that parse pprof's output, and we offer no guarantees not to break them.
The other place where we use units is on the unit fields in profile.proto and the command line override, where we recognize kb/mb/gb to mean kiB, MiB, GiB, etc... This is also ambiguous at best, and problematic because changing it could cause us to stop parsing existing profiles. In reality I don't know if we have any profile sources that currently generate profiles with anything other than 'b', but if there are we would break them. A quick search over the accessible code shows only profiles generated using 'bytes', so this is probably worthwhile to do in general. It would only affect people that are used to specifying units by hand to pprof. For example, pprof -unit=mb would change from MiB to MB, and instead users would have to say pprof -unit=MiB (or maybe pprof -unit=mib).
The text was updated successfully, but these errors were encountered: