W dniu poniedziałek, 6 maja 2013 05:12:37 UTC+2 użytkownik Ben Mabey 
napisał:
>
> On Sun May  5 18:31:59 2013, Mikera wrote: 
> > On Tuesday, 30 April 2013 04:12:14 UTC+8, Jan Stępień wrote: 
> > 
> >> Dear Clojurians, 
> >> 
> >> I'm very happy to announce Himilsbach 0.0.1. 
> >> 
> >> Himilsbach is a tiny actor library for intra-process messaging inspired 
> by 
> >> Erlang. 
> >> 
> >> Find it at https://github.com/jstepien/himilsbach 
> >> 
> >> Your feedback is very much appreciated! 
> >> 
> > 
> > Nice - been looking for some Erlang-style features in Clojure for a 
> while. 
> > 
> > How does this compare with Pulsar? 
> > - https://github.com/puniverse/pulsar 
> > 
> > 
> > 
>
> Looking at the source of Himilsbach it seems to be using java (OS) 
> threads where as Pulsar allows for light weight threads and regular JVM 
> threads. 
>
>
Thanks for pointing me to Pulsar; I find it very interesting. From
what I've learned reading Pulsar's announcement blog post,
Himilsbach differs from Pulsar in a number of ways.

Himilsbach is a very simple library focusing solely on concurrent
message passing. Unlike Pulsar, Himilsbach doesn't offer
abstractions over IO, fibers, nor channels inspired by Go. Local
actor's state is also absent in Himilsbach, since users of the
library can easily add it themselves using refs or agents.
Minimalism of the offered API has been one of my goals.

Pulsar seems to be a more faithful adaptation of Erlangs approach.
Both Himilsbach and Pulsar cover the basic principles of message
passing and linking processes, but, for example, only the latter
supports selective receive. There's nothing preventing this feature
being implemented in Himilsbach though and I think it would be a
good addition to the API.

As noted by Ben, actors in Himilsbach are run in futures, and
consequently they are executed in regular JVM threads. This results
in worse performance in case of workload with many context switches.
I did some benchmarks using OpenJDK 1.7.0-u21-b12.

I ported the full graph benchmark from Himilsbach to Pulsar. I ran
it for 1k actors exchanging 1M messages in total. Results for 75
executions are following. Time measurements are given in ms.

              Pulsar    Himilsbach
    Mean      551       1151
    Median    526       1041
    St. dev.  144       399

To make the comparison fair I implemented the ring benchmark
discussed in Pulsar's announcement blog post using Himilsbach's
actors. Again, I ran it for 1k actors exchanging 1M messages in
total. Results for 75 executions indicate that Pulsar excels in
this benchmark.

              Pulsar    Himilsbach
    Mean      722       12311
    Median    714       12312
    St. dev.  57        333

Tests were run against commits e3c208e in case of Pulsar and b2b44e1
in case of Himilsbach. I've attached code of two adapted benchmarks.

Finally, Himilsbach currently works on JVM 6/7/8. As I've learned
from Ron Pressler, the Pulsar's author, his library requires JVM 7
due to dependence on the Fork/Join framework. JVM 8 support is on
Pulsar's to-do list.

I'm adding Ron Pressler to CC in case he'd like to clarify something
or comment on this comparison.

All the best,
--
Jan Stępień

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Attachment: graph_old.clj
Description: Binary data

Attachment: ring.clj
Description: Binary data

Reply via email to