Code Monkey home page Code Monkey logo

akka-bench's Introduction

==============================
===Two different benchmarks===
==============================

The project currently consists of different benchmarks. These two 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.

================================
===Download service benchmark===
================================

--------------
Benchmark between:
* Akka (Scala 2.7.7)
* Scala Actors (Scala 2.7.7)
* 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:
~20 seconds

Akka with ReactorBasedSingleThreadEventDrivenDispatcher:
~9 seconds

Scala Actors with 'react': 
~ 18 seconds

Scala Actors with 'receive': 
~ 13.5 seconds

=========================
===Chameneos benchmark===
=========================

--------------
Benchmark between:
* Akka (Scala 2.7.7)
* Scala Actors (Scala 2.7.7)
* 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

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.