jmh-gradle-plugin icon indicating copy to clipboard operation
jmh-gradle-plugin copied to clipboard

Incorrect encoding for JMH output

Open sergey-morenets opened this issue 7 years ago • 5 comments

Hi

I tried to use JMH Gradle plugin for my project but JMH prints weird question marks instead of correct numbers (Gradle 4.3.1, command gradle jmh):

Benchmark                                            (provider)  Mode  Cnt   Score    Error  Units
FieldProviderBenchmark.getFieldNames_targetCityCopy       Basic  avgt   20  ? 10??            s/op
FieldProviderBenchmark.getFieldNames_targetCityCopy      Cached  avgt   20  ? 10??            s/op

However jmh-result.text generated during this build looks correct:

Benchmark                                            (provider)  Mode  Cnt     Score    Error  Units
FieldProviderBenchmark.getFieldNames_targetCityCopy       Basic  avgt   20  1140,589 ± 11,138  ns/op
FieldProviderBenchmark.getFieldNames_targetCityCopy      Cached  avgt   20   127,683 ±  0,923  ns/op

I tried to change default JVM encoding but the issue still reproduces:

jmh {
  jvmArgs = '-Dfile.encoding=UTF-8'
}

Please advise.

sergey-morenets avatar Nov 29 '17 12:11 sergey-morenets

Hi @melix

Any progress on this? This issue still reproduces with Gradle 4.8 and plugin version 0.4.7

sergey-morenets avatar Sep 02 '18 20:09 sergey-morenets

Hello @sergey-morenets did u find solution for this issue?

DotSpy avatar Feb 04 '20 11:02 DotSpy

@DotSpy Did it reproduce for you on the latest version? I hasn't tested this cases for a long time ...

sergey-morenets avatar Feb 05 '20 16:02 sergey-morenets

Yeah, i think it issue with gradle\OS

DotSpy avatar Feb 05 '20 21:02 DotSpy

Same issue here

Iteration  11: Ôëł 10Ôü╗ÔüĚ ms/op
Iteration  12: Ôëł 10Ôü╗ÔüĚ ms/op
Iteration  13: Ôëł 10Ôü╗ÔüĚ ms/op
Iteration  14: Ôëł 10Ôü╗ÔüĚ ms/op
Iteration  15: Ôëł 10Ôü╗ÔüĚ ms/op
Iteration  16: Ôëł 10Ôü╗ÔüĚ ms/op

EDIT: for windows users try chcp 65001 to change cmd to utf-8

Nightenom avatar Apr 17 '24 09:04 Nightenom