-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
proposal: cmd/benchstat: support optional ascii-only output #64210
Comments
/cc @aclements |
Personally I'm unconvinced. I run terminals other tools from 30 years ago and they can print these characters. |
This proposal has been added to the active column of the proposals project |
I agree with @rsc. Terminal environments have had good support for Unicode for a long time. If something is misconfigured resulting in broken Unicode support, it would seem better to fix that configuration than to have every tool that may print Unicode work around it. Is there a concrete issue that this causes? |
Anecdotally, I've found that PowerShell's insistence on UTF-16 for pipes causes strange behaviors with benchstat's non-ASCII characters when working on Windows. If I pipe benchstat into clip.exe and then paste into an editor, the special characters are replaced with a |
That actually sounds like a possible Go runtime bug to me. For console output, the runtime transparently reencodes UTF-8 as UTF-16, but this sounds like another place where it should potentially be doing that. On the other hand, pipes are also used for non-text data, so it might be impossible for the runtime to transparently tell what the right thing is. @zephyrtronium , I'm also curious how you're collecting benchmark results such that they're in UTF-16LE. |
If I run If I pass those UTF-16 files directly into benchstat, it gives no output, since it expects UTF-8. If I re-encode them to UTF-8 with LF line endings, then:
(Hopefully this isn't getting too far off-topic. Let me know if I should open another issue.) |
@zephyrtronium Please do open another issue. I've reproduced what you are saying under PowerShell, but not under cmd.exe. It sounds like PowerShell is doing very very strange things. |
Based on the discussion above, this proposal seems like a likely decline. |
Created #65157 for the PowerShell / UTF-16 issue. |
No change in consensus, so declined. |
Some runes in the benchstat output, particularly
µ
and±
, but also super-script numbers (¹
²
, etc), may not render well in some terminals (or when processed with some tools whenLANG
is not properly configured, such as withless
).I propose, either via CLI flag or environment variable detection, we instead output
u
and either+-
or~
.The text was updated successfully, but these errors were encountered: