profiler icon indicating copy to clipboard operation
profiler copied to clipboard

Truncated numbers in the source view when viewing allocation sizes

Open mstange opened this issue 3 years ago • 10 comments

Profile: https://share.firefox.dev/3ePzHNf

When displaying allocation sizes, the numbers in the source view are truncated.

Screen Shot 2022-09-13 at 4 54 10 PM

mstange avatar Sep 13 '22 20:09 mstange

I would recommend just increasing the width, so that all reasonable numbers can be presented.

parttimenerd avatar Sep 21 '22 09:09 parttimenerd

In this case I believe it would make more sense to be able to change the unit. But haven't looked at the code yet, to know how easy this would be.

julienw avatar Sep 22 '22 08:09 julienw

You mean using KB? That should be harder to implement, as we would need changes at a lot of places.

parttimenerd avatar Sep 22 '22 08:09 parttimenerd

Or just use "K" and "M". Or maybe just "M".

julienw avatar Sep 22 '22 08:09 julienw

Why M? This is far too large granularity for most use case. It is a difficult change, as it either introduces a new Unit or modifies how we deal data sources.

parttimenerd avatar Sep 22 '22 09:09 parttimenerd

I agree with Julien that it would be nice to show units here. Users might be unaware that they've selected allocations in the dropdown above, and showing KB / MB would remind them that they're looking at allocation sizes. We can make the columns wider at the same time, of course.

mstange avatar Sep 22 '22 17:09 mstange

Oh, I had missed that we already display "Total (bytes)" in the table header.

I'd prefer the following behavior: Display "Total" in the table header, and display "23 B" / "1.6 KB" / "265.2 MB" in the table cell, depending on the size.

mstange avatar Sep 22 '22 18:09 mstange

I find this really confusing. It makes reading the numbers down the table quite unintuitive (as the length of the number is commonly an indicator of the size of the number in such tables).

I actually find the conditional showing of the first decimal place a bit hard to view. In my opinion, we should stick to the same format for all entries.

parttimenerd avatar Sep 23 '22 06:09 parttimenerd

I agree with Julien that it would be nice to show units here. Users might be unaware that they've selected allocations in the dropdown above, and showing KB / MB would remind them that they're looking at allocation sizes. We can make the columns wider at the same time, of course.

With this logic, we could add "s/ms/ns" to the timings view too (which I'm totally against too).

As a compromise: Could we allow the users (by e.g. clicking on the "bytes" in the column header) or the profile writer to choose between the two options?

parttimenerd avatar Sep 23 '22 06:09 parttimenerd

This is what VisualVM is showing:

image

parttimenerd avatar Sep 23 '22 08:09 parttimenerd