GithubHelp home page GithubHelp logo

liminzhang / fiber-test Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vy/fiber-test

0.0 2.0 0.0 172 KB

Performance comparison of a multitude of thread/fiber implementations for JVM.

Shell 8.19% Java 91.81%

fiber-test's Introduction

This project bundles a set of benchmarks that aims to measure the performance of a multitude of threading implementations in the Java Virtual Machine.

Benchmarks

As of now, there is just a single benchmark (ring) adopted from the Performance Measurements of Threads in Java and Processes in Erlang article. I plan to introduce new benchmarks as time allows. That being said, contributions are welcome.

Implementations

Project employs 3 threading libraries to implement fibers in the benchmarks.

  1. Standard Java Threads
  2. Akka Actors
  3. Quasar Fibers and Actors

Usage

You first need to build the JMH Uber JAR using Maven.

$ mvn clean install

Next, you can either use the provided benchmark.sh script

$ ./benchmark.sh --help
Available parameters (with defaults):
    workerCount (503)
    ringSize    (1000000)
    cpuList     (0-1)

# You can run with default parameters.
$ ./benchmarks.sh

# Alternatively, you can configure parameters through environment variables.
$ ringSize=500 workerCount=30 cpuList=0-7 ./benchmark.sh

or call JMH manually:

$ java \
> -jar target/fiber-test.jar \
> -jvmArgsAppend "-DworkerCount=503 -DringSize=1000000 -javaagent:/path/to/quasar-core-<version>.jar" \
> -wi 5 -i 10 -bm avgt -tu ms -f 5 \
> ".*RingBenchmark.*"

Instead of using JMH, you can additionally use assembly:single goal to create an all-in-one JAR and run benchmarks individually.

$ mvn assembly:single
$ java \
> -server -XX:+TieredCompilation -XX:+AggressiveOpts \
> -DworkerCount=503 -DringSize=10000000 \
> -javaagent:/path/to/quasar-core-<version>.jar \
> -cp target/fiber-test-<version>-jar-with-dependencies.jar \
> com.github.vy.fibertest.QuasarFiberRingBenchmark

Results

For Oracle Java 1.8.0_60-b27 running on Intel(R) Core(TM) i7-4702MQ CPU @ 2.20GHz on Linux 3.13.0-63-generic x86_64 kernel:

JavaThreadRingBenchmark.ringBenchmark      avgt   50  7741,274 ± 476,113  ms/op
QuasarActorRingBenchmark.ringBenchmark     avgt   50  1702,764 ±  65,940  ms/op
QuasarDataflowRingBenchmark.ringBenchmark  avgt   50  1512,901 ±  55,922  ms/op
QuasarChannelRingBenchmark.ringBenchmark   avgt   50  1417,803 ±  49,837  ms/op
AkkaActorRingBenchmark.ringBenchmark       avgt   50   892,533 ±  50,865  ms/op
QuasarFiberRingBenchmark.ringBenchmark     avgt   50   832,529 ±  47,586  ms/op

License

The fiber-test by Volkan Yazıcı is licensed under the Creative Commons Attribution 4.0 International License.

Creative Commons Attribution 4.0 International License

fiber-test's People

Contributors

vy avatar arkadius avatar

Watchers

James Cloos avatar Limin  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.