Giter Club home page Giter Club logo

java-benchmarks's Introduction

Java Benchmarks

We've seen many Java code snippets that suppose to improve some performance. In many cases, there was NO real improvement with the additional code. Instead, the code gets bigger for no real reason.

With this project we will try to bust or prove some common performance myths.

๐Ÿ”ฎ How do we measure?

It is not easy to write micro-benchmark code. Fortunately (and finally), we have an excellent tool for that: JMH.

๐Ÿ““ How the project is organized?

Each benchmark suite is stored in a single class with a name that must end with Benchmark. Every benchmark class explains in java docs what the goal is, i.e. what is going to be measured and why. Each benchmark suite should have at least two individual benchmark methods.

Moreover, each java doc will also contain the actual benchmark results.

๐Ÿš€ How to run the benchmarks?

Easy :) The project is using Gradle. Benchmarks may be run just by passing the bechmark class name. Since class name must end with Benchmark, Gradle will recognize it and run it. For example:

gradlew clean FooBenchmark

Running clean task first is optional.

When running benchmarks, try not to use your computer for anything else. Try to minimize the number of background tasks.

โŒš What does the values means?

Values of individual benchmark are not relevant! What matter is the relationship between the individual benchmarks and the standard deviation of the values. Only by comparing the benchmark values we can say if one has better performance then the other.

โ™จ๏ธ Use it with caution!

Don't take results as written in a stone. Think! Sometimes the input values (volume and the content) dictates the performance results.

โ™ฅ๏ธ Contribute!

Feel free to add your own benchmarks. Let us know if you want us to measure something.

Java benchmarks - the answers on common performance concerns!

java-benchmarks's People

Contributors

igr avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

restmad

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.