Average time computation just prints out "10??"

David Karr davidmichaelkarr at gmail.com
Mon Oct 1 01:44:51 UTC 2018


On Sun, Sep 30, 2018 at 4:34 AM Aleksey Shipilev <shade at redhat.com> wrote:

> On 09/30/2018 03:02 AM, David Karr wrote:
> > On Sat, Sep 29, 2018 at 4:57 PM Bernd Eckenfels <ecki at zusammenkunft.net>
> > wrote:
> > I guess that's an improvement. I still can't read it in my text editor,
> but
> > I can paste it into my browser and see what it was supposed to be
> > printing.  This produces a text line like this:
> > -----------------
> > # Warmup Iteration   1: ≈ 10⁻⁵ s/op
> > -----------------
> >
> > Why did the JMH implementors decide to introduce the complexity of
> unicode
> > into this?  This should be simple textual information.  I shouldn't have
> to
> > work this hard to get this.
>
> Maintainer's perspective: in the year 2018, JMH or any other power user
> tool should be not be held
> hostage by environments that do not properly support Unicode. Notice, for
> example, how browsers and
> mail clients show this correctly.
>
> Anyway, "≈ 10⁻⁵ s/op" is the sign that the units selected are very far off
> default precision. The
> order of magnitude gives you the hint by how much, without letting you use
> the low-precision data.
> Or, as in this case, raise the question what is printed exactly -- think
> about this as a glorified
> Not-A-Number value. In this example, time units should be microseconds,
> not seconds.
>

Ok, so HOW do I set the time units to microseconds?  I tried adding the
following as a class annotation:

    @Measurement(timeUnit = TimeUnit.MICROSECONDS)

This didn't seem to make much difference.  I still see the encoded
characters in all the results, and when I view it in the browser, it shows
numbers like 10**-5, and it still shows "s/op", as if the time units are
still seconds.


> -Aleksey
>
>


More information about the jmh-dev mailing list