Giter Site home page Giter Site logo

Comments (4)

vladmihalcea avatar vladmihalcea commented on July 2, 2024

Thanks for the tip. System.currentTimeMillis() is indeed bad, and nanoTime() is not monotonical and it has a varying precision between 10-1000 nanoseconds. For low latency benchmarks, nanoTime() is not very helpful, especially if the error keeps on accumulating (like measuring inside a loop).

I've been also using Codahale/Dropwizard metrics and they have two types of Clocks:

  • the default one is based on System.nanoTime()
  • the second one uses the CPU-time ManagementFactory.getThreadMXBean().getCurrentThreadCpuTime().

But when it comes to a RDBMS, we are often talking about millisecond precision. Most test results are in milliseconds and even if we assume that nanoTime has a one microsecond precision, it shouldn't affect the test results as I need to round the results anyway. In one test, I think I showed the results rounded to 10 microseconds though.

from high-performance-java-persistence.

vlsi avatar vlsi commented on July 2, 2024
  1. The thing is JMH forces you into well-structured, understandable benchmarks.
    That is a big plus since that enables review of the benchmarks by experienced engineers.

  2. Even in JDBC world there are nano-second scale measurements.
    For instance, .prepareStatement(String) & close() is in that range.

  3. "average" is not sufficient. You need to show standard deviation, test under multiple threads, etc, etc.

from high-performance-java-persistence.

vladmihalcea avatar vladmihalcea commented on July 2, 2024

The JMH uses GPLv2. Aren't the stubs it generates also licensed as GPLv2? If that's the case, it won't be compatible with Apache 2.0 license of this particular repository.

from high-performance-java-persistence.

vladmihalcea avatar vladmihalcea commented on July 2, 2024

The idea is good but the real scope of these benchmarks is to prove we have an improvement, not to provide absolute or relative gains which will still be environment depending.

from high-performance-java-persistence.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.