GithubHelp home page GithubHelp logo

xyuan / jvm-micro-benchmarks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from peter-lawrey-admin/jvm-micro-benchmarks

0.0 2.0 0.0 152 KB

Microbenchmarks for JVM code.

License: Apache License 2.0

Java 100.00%

jvm-micro-benchmarks's Introduction

jvm-micro-benchmarks

Microbenchmarks for JVM code.

Some benchmarks use JMH for latency test.

Co-ordinated omission

Some benchmarks are hand written to compensate for co-ordinated ommission.
Co-ordinated ommission can result in dramatically under rating poor latencies.
The difference can be that your 99.999% latency with co-ordniated omission is actually you 90% latency. Correcting for co-ordinated omission can help how why you have problems in real systems.

The way we correct for co-ordinated omission is to not time the latency from when we start the test, but instead we time from when the tests should have started. To have a view on this, we have to have a throughput we are testing for. One way of doing this is to tst at regular intervals, however this can give overly optimisitic figures as well. To produce more robust figures we randomise the time between tests so that we have an average interval which achieves the desired throughput.

int rate = ... ; // the rate being tested.
long next = System.nanoTime();
int interval = (int) (1e9 / rate);
Random rand = new Random();
for (int t = 0; t < tests; t++) {
    next += rand.nextInt(2 * interval); // avg = interval.
    while(System.nanoTime() < next) {
        // busy wait
    }
    
    performTest(i);
    
    times[i] = System.nanoTime() - next;
}

jvm-micro-benchmarks's People

Contributors

peter-lawrey avatar

Watchers

Xingqiu Yuan avatar  avatar

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.