On Windows there is formating error when using compare.py
So I am trying to compare my benchmark but it is really hard because the output contains garbage characters.
python.exe D:_Dev\Playground\gBenchmarkVulkan/bazel-gbenchmarkvulkan/external/gbenchmark/tools/compare.py filters D:_Dev\Playground\gBenchmarkVulkan/benchmark.json NoExcept WithExcept Comparing NoExcept to WithExcept (from D:_Dev\Playground\gBenchmarkVulkan/benchmark.json) Benchmark Time CPU Time Old Time New CPU Old CPU New
[92mvkInstanceCreationUnique[NoExcept vs. WithExcept][0m[97m +0.0067[0m[97m +0.0250[0m 107057091 107769236[0m 56818182 58238636
I don't see anything odd in the attached JSON. Might this be a windows python interpreter issue?
I created an other issue for the json, what is wrong is the backslashes they should be escaped, or slashes or when the field is read to be canonalized.) The problem that i am reporting here is the output to the console. Those characters � and [92. Either it is reading bad memory or there is a locale issue, or something else.
I believe the issue is about Unicode. I looked at the python code and in report.py in the function generate_difference_report the var first_line is an ASCII string but in the JSON object, the strings are Unicode and then later in the function color_format the strings are formatted with an ASCII fmt_str.
I believe this is the culprit for the bad display of the characters.
I guess the solution is to go all ASCII or all Unicode, I am just not sure with the one you want.
Perhaps these ascii escape sequences are simply too advanced for that windows console? Is there an unicode alternative for them? If not, simply disabling formatting for incompliant output devices may be the solution.
I just ran into this problem and it looks like it's the color output that's the problem. If I disable the colors, I don't get any garbage characters. So at least there's a workaround
I just ran into this problem and it looks like it's the color output that's the problem. If I disable the colors, I don't get any garbage characters. So at least there's a workaround
I just tried v1.5.0 with this command line F:_Dev\Playground\gBenchmarkVulkan\bazel-gbenchmarkvulkan\external\gbenchmark\tools> python.exe .\compare.py filters f:_Dev\Playground\gBenchmarkVulkan\benchmark.json NoExcept WithExcept --benchmark_color=false
and I still get the wrong character in the console Maybe there is another way to disable the colors.? In anycase, I never had any colors in the compare console out.
If I remember correctly, there is no color command line argument. I disabled the colors directly in the color_format() function in report.py