Skip to content

Conversation

@hugovk
Copy link
Member

@hugovk hugovk commented Dec 18, 2025

Thing Before After
Console
Captured 4497 samples in 0.45 seconds
Sample rate: 10000.01 samples/sec
Error rate: 13.74%
Heatmap output written to heatmap_69830/
- Index: heatmap_69830/index.html
- 93 source file(s) analyzed
Captured 4,411 samples in 0.44 seconds
Sample rate: 10,000.01 samples/sec
Error rate: 20.40%
Heatmap output written to heatmap_70238/
- Index: heatmap_70238/index.html
- 92 source files analyzed
Index header image image
Index file list image image
Single file header image image
Single file specialisation image image

I used the UX improvement issue (#142927) for this, but can change it to the main implementation one (#138122) or another.

@picnixz
Copy link
Member

picnixz commented Dec 18, 2025

I'd like to suggest using a locale translation for separating numbers instead of using english-based values. I am personally always confused when commas are used to separate thousands and I think it's better if it's using a localized output.

@StanFromIreland
Copy link
Member

I disagree with the "Single file specialisation," IMO the plural sounds better and in general zero takes a plural noun form?

@hugovk
Copy link
Member Author

hugovk commented Dec 18, 2025

I'd like to suggest using a locale translation for separating numbers instead of using english-based values. I am personally always confused when commas are used to separate thousands and I think it's better if it's using a localized output.

Right now, the numbers are formatted in the Python script, and then put into the HTML. I guess one way would be to put unformatted numbers in the HTML and use some JS to do locale conversion in the browser?

@hugovk
Copy link
Member Author

hugovk commented Dec 18, 2025

I disagree with the "Single file specialisation," IMO the plural sounds better and in general zero takes a plural noun form?

"x/y" is like saying "x of y", and it's the "y" that matters for the plural:

  • "0 of 0 instructions"
  • "0 of 1 instruction"
  • "1 of 1 instruction"
  • "1 of 4 instructions"
  • "3 of 4 instructions"

@picnixz
Copy link
Member

picnixz commented Dec 19, 2025

Right now, the numbers are formatted in the Python script, and then put into the HTML. I guess one way would be to put unformatted numbers in the HTML and use some JS to do locale conversion in the browser?

Can't we use localized messages? or maybe pass through locale.(...) for formatting numbers?

@hugovk
Copy link
Member Author

hugovk commented Dec 19, 2025

Yes, and that's much simpler :)

How does this 9cfd9ef look?

@picnixz
Copy link
Member

picnixz commented Dec 19, 2025

It looks better (and simpler). For the "words" we can also use gettext.ngettext to get a possible localized plural form (I don't know if you want all messages to be localized actually, but I think it may makes sense. argparse has localized output and profiling is something that is also very user-facing)

@hugovk
Copy link
Member Author

hugovk commented Dec 19, 2025

I'll let you open a followup if you'd like to localise the words :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants