Giter VIP home page Giter VIP logo

concurrency-library-benchmark's Introduction

Kotlin Coroutines & LMAX Disruptor Benchmark Project

This project benchmarks the performance of Kotlin Coroutines and LMAX Disruptor, two popular tools for asynchronous and concurrent programming in the JVM. The benchmark uses the Java Microbenchmark Harness (JMH) for accurate and reliable performance measurements.

Kotlin Coroutines

Kotlin Coroutines is a library for writing asynchronous, non-blocking code in Kotlin. It provides a lightweight and expressive way to write asynchronous code, making it easier to write and understand concurrent programs.

LMAX Disruptor

LMAX Disruptor is a high-performance inter-thread communication library for the JVM. It provides a fast and efficient way to pass data between threads, making it well-suited for high-throughput and low-latency applications.

Benchmarking

The project benchmarks the performance of Kotlin Coroutines and LMAX Disruptor by measuring the time it takes for a large number of events to be processed by each library. The results of the benchmark can be used to compare the performance of the two libraries and help developers choose the best tool for their specific use case.

How to Run the Benchmark

To run the benchmark, clone the repository and run the following command:

./gradlew :jmh-benchmark:jmh -Dorg.gradle.java.home=$(/usr/libexec/java_home -v17)
(export JAVA_VERSION=17 && export DATE=$(date +%Y-%m-%d-%H-%M-%S) && ./gradlew clean build :jmh-benchmark:jmh -Dorg.gradle.java.home=$(/usr/libexec/java_home -v$JAVA_VERSION))

The results of the benchmark will generate in result directory

Visualized Result

After running the benchmark, the results will be generated in the result directory. For a fair comparison between the two libraries, these results can be visualized using https://jmh.morethan.io/.

Conclusion

Based on the benchmark results, it can be concluded that Kotlin Coroutines have better throughput compared to LMAX Disruptor, however, they consume more memory. The choice between the two ultimately depends on the specific requirements of the application and the trade-offs the developer is willing to make.

Contributing

If you're interested in contributing to this project, please reach out to the project maintainers. We're always looking for ways to improve the benchmark and make it more comprehensive.

concurrency-library-benchmark's People

Contributors

thanhtrixx avatar

Watchers

 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.