HTML5 Canvas
Written by: Simon Sarris
Featured Refcardz: Top Refcardz:
  1. Apache Hadoop
  2. Web Driver
  3. MVVM
  4. REST
  5. ADO.NET
  1. HTML5
  2. Ajax
  3. jQuery Selectors
  4. CSS Part 1
  5. Git

Link Details

Link 36215 thumbnail
User 217101 avatar

By gst
via weblog.plexobject.com
Published: Aug 22 2007 / 03:28

I have been reading Joe Armstrong’s Erlang book recently and one of the assignment is to compare performance of processes and message communication by creating a ring of processes and sending messages. The assignment needs to be done in two languages so I Java as another language.
  • 15
  • 0
  • 3748
  • 2

Comments

Add your comment
User 225026 avatar

bago replied ago:

0 votes Vote down Vote up Reply

I don't understand why his java inner classes are not "static": this is a waste of resources. Follower and Loader should be declared static.

I didn't run the benchmark myself, but before running benchmark the code should be written correctly ;-)

User 85500 avatar

andrewm replied ago:

0 votes Vote down Vote up Reply

Threads in Erlang are not the same as OS-level threads in Java. they are closer to non-preemptive coroutines. no suprise that you can't allocate a bazillion OS-level threads. Languages like Erlang and Oz are designed to allow the creation of many lightweight threads. For instance, in the Oz book, one example allocates 10,000 threads!

A better performance comparison would allocate multiple activities to a single OS-level thread and switch between them using simple Java classes. It's nowhere near as elegant as in Erlang, but that's the way it is done in Java.

Also, pattern matching as a dispatch mechanism for messages is one of Erlang/Oz's great strengths. I find it more powerful than an object dispatch mechanism.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.