jboner / akka-bench Goto Github PK
View Code? Open in Web Editor NEWBenching Akka against various other concurrency libraries and approaches
Benching Akka against various other concurrency libraries and approaches
================================ ===Three different benchmarks=== ================================ The project currently consists of different benchmarks. These three benchmarks stresses the actors very differently, which can be seen in the results in that which kind of execution strategies (schedulers/dispatchers) varies a lot between benchmarks. ================================== ===Build and Run the benchmarks=== ================================== All the six modules in the two benchmarks are build with SBT. Step into each module and invoke: $ sbt update $ sbt run This should download dependencies, build and run the benchmark and print out the results to the console. ======================== ===Pipeline benchmark=== ======================== -------------- Benchmark between: * Akka 0.8.1 (Scala 2.8.0.Beta1) * Scala Actors (Scala 2.8.0.Beta1) * Jetlang (Java) -------------- Description: It originates from this article (which compares some more Java actor frameworks): http://sujitpal.blogspot.com/2009/01/more-java-actor-frameworks-compared.html This benchmark consists of three stages 'Download -> Index -> Write' and tries to emulate a pipeline service. Jetlang was chosen as Java implementation since it is widely known as the fastest and most scalable Java Actors library. It might be a matter of taste but I find both of the Actor implementations significantly more straightforward, clear and easy to understand. -------------- Result doing 1 million requests: Jetlang: ~6.5 seconds Akka with ThreadBasedDispatcher: ~8.5 seconds Akka with ExecutorBasedEventDrivenDispatcher: ~11 seconds Akka with ReactorBasedSingleThreadEventDrivenDispatcher: ~9 seconds Scala Actors with 'react': ~ 18 seconds Scala Actors with 'receive': ~ 13.5 seconds ========================= ===Chameneos benchmark=== ========================= -------------- Benchmark between: * Akka 0.8.1 (Scala 2.8.0.Beta1) * Scala Actors (Scala 2.8.0.Beta1) * Thread/synchronized (Java) -------------- Description: This benchmark originates from http://shootout.alioth.debian.org/. It is not really fair to compare an idiomatic Actor-based implementation with the most brutal bare-bones thread-based implementation. If one looks at the Java thread-based implementation one can see that it sends 1 message to the global 'MeetingPlace' which then performs all the logic under one single global lock, then directly accessing *public* variables (that I think should be private) in the different Chameneos. For each of these single messages the idiomatic Actor implementation sends 3 messages and lets each Chameneos actor update its state internally. Both of the Actor implementations (Akka and Scala Actors) are fairly clean conceptually and allows for refactoring, extensibility and reuse, something that can't be said for the Java thread implementation. But I think it is fair to say that Akka (with its ExecutorBasedEventDrivenDispatcher) is still performing surprisingly well. -------------- Result doing 1 million messages: Java Thread-based with single resource: ~ 1 second Akka with ExecutorBasedEventDrivenDispatcher: ~ 3.5 seconds Akka with ThreadBasedDispatcher: ~ 12.5 seconds Scala Actors with 'react': ~ 11 seconds Scala Actors with 'receive': ~ 21 seconds ========================== ===Token Ring benchmark=== ========================== -------------- Benchmark between: * Akka 0.8.1 (Scala 2.8.0.Beta1) * Scala Actors (Scala 2.8.0.Beta1) -------------- Description: Sends a token around a ring of 10 actors one million times. -------------- Result: TODO
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.