http://gist.github.com/120289 using queues and Threads instead of agents
On Fri, May 29, 2009 at 4:11 PM, Laurent PETIT wrote:
>
> Hi,
>
> here is a second attempt, partly inspired by clojure's agents page,
> that looks better (true direct ring of agents, not just indirect ring
> via vector), an
Hi,
here is a second attempt, partly inspired by clojure's agents page,
that looks better (true direct ring of agents, not just indirect ring
via vector), and that performs similarly to my first attempt.
Still room for progress, though.
(ns shootout.ring2
(:gen-class))
(def n-threads 503)
(de
Would type hints help at all?
On May 29, 11:40 am, Laurent PETIT wrote:
> Hi,
>
> Here is my attempt, for the real benchmark test, it has an honorable
> result of 62 sec. (if there is no flaw in my algorithm, of course).
>
> ;; file shootout/ring.clj
> (ns shootout.ring
> (:gen-class))
>
> (de
Hi,
Here is my attempt, for the real benchmark test, it has an honorable
result of 62 sec. (if there is no flaw in my algorithm, of course).
;; file shootout/ring.clj
(ns shootout.ring
(:gen-class))
(def n-threads 503)
(def nb-pass 5000)
(defn main
"main function calling the benchmar
Thanks, seems that I misunderstood Agents :)
The solution of Christian works well with full load, but maybe slow for the
benchmark. In my core2duo, with full load, takes about 28mins to compute the
result.
user=> (do (println (System/nanoTime)) (start 5000))
22651751153117
#
user=> 292 ( 2431
On Fri, May 29, 2009 at 4:29 PM, Laurent PETIT wrote:
> when I try it with the 50,000,000 number of times the token is
> exchanged (which is the number to be used for the benchmark)
Oh, right. I only noticed the 1000 mentioned at the bottom. Also, the
(time ...) makes no sense.
> How would one
On Fri, May 29, 2009 at 3:29 PM, Christian Vest Hansen
wrote:
>
> For kicks, I made an implementation* using agents:
>
> http://gist.github.com/119946
The call to time returns almost immediately and the actual result
takes much longer to appear (with large values of token). How would
one fix th
Sorry, I understood that the (shutdown-agents) call is certainly
responsible for this.
2009/5/29 Laurent PETIT :
> Hi,
>
> didn't take time to analyse why, but your solution sends a
>
> java.util.concurrent.RejectedExecutionException
>
> when I try it with the 50,000,000 number of times the token
Hi,
didn't take time to analyse why, but your solution sends a
java.util.concurrent.RejectedExecutionException
when I try it with the 50,000,000 number of times the token is
exchanged (which is the number to be used for the benchmark)
2009/5/29 Christian Vest Hansen :
>
> For kicks, I made an
Have you seen the example on the agents page of the main clojure site?
http://clojure.org/agents
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegrou
For kicks, I made an implementation* using agents:
http://gist.github.com/119946
I think that you may not want to use the STM so much and instead
figure out a different approach to sending the token around the ring.
*it may be a bit liberal in its interpretation of the rules... didn't
read them
11 matches
Mail list logo