我的输出没有显示完整的数字,但显示 ??反而

发布于 2025-01-16 13:52:11 字数 234 浏览 2 评论 0原文

我正在尝试使用 JMH 进行基准测试,基准测试结果确实出来了,但并不完美
输入图片这里的描述

不知何故有??在数字中,是否是我的 IDE 的问题,我需要进行设置以显示完整的数字或其他内容?

I'm trying to do benchmarking with JMH, the benchmarking result did come out but not perfectly
enter image description here

Somehow there's ?? in the numbers, is it the problem with my IDE where I need to set up the settings to show the full numbers or something?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

春花秋月 2025-01-23 13:52:11

JMH 输出使用扩展的 Unicode 字符。尤其, ? 10?? s/op”可能意味着“≈ 10⁻1⁰ s/op”。

要解决这个问题

@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public class MyBenchmark {

The JMH output makes use of extended Unicode characters. In particular, ? 10?? s/op" probably means "≈ 10⁻¹⁰ s/op".

To solve it

@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public class MyBenchmark {
┊风居住的梦幻卍 2025-01-23 13:52:11

您面临的是编码问题。

默认情况下,JMH 将其输出编码为 UTF-8,因此您将看到错误列的 ±,而不是那些 ??,例如 ≈ 10⁻³ > 用于 Linux 或 Mac 上的分数列。

在 Windows 上,终端支持 Unicode,但不完全支持,这就是为什么您会看到 ?? 而不是某些符号。要解决此问题,请按照另一个 SO 问题中描述的手册进行操作:如何在 Windows 命令行中使用 unicode 字符?

What you are facing is an encoding issue.

JMH by default encodes its output as UTF-8 so instead of those ?? you'll see ± for Error column and e.g. ≈ 10⁻³ for Score column on Linux or Mac.

On Windows Unicode is supported in terminal but not entirely, this is why you see ?? instead of some symbols. To fix this please follow the manual described in another SO question: How to use unicode characters in Windows command line?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文