On Fri, Nov 29, 2013 at 11:03 PM, Ben Mabey <b...@benmabey.com> wrote:

>  On 11/29/13, 8:33 PM, Cedric Greevey wrote:
>
>  Have you checked for other sources of performance hits? Boxing, var
> lookups, and especially reflection.
>
> As I said, I haven't done any optimization yet. :)  I did check for
> reflection though and didn't see any.
>
>
>  I'd expect a reasonably optimized Clojure version to outperform a Python
> version by a very large factor -- 10x just for being JITted JVM bytecode
> instead of interpreted Python, times another however-many-cores-you-have
> for core.async keeping all your processors warm vs. Python and its GIL
> limiting the Python version to single-threaded performance.
>
> This task does not benefit from the multiplexing that core.async provides,
> at least not in the case of a single simulation which has no clear logical
> partition that can be run in parallel.  The primary benefit that core.async
> is providing in this case is to escape from call-back hell.
>

Hmm. Then you're still looking for a 25-fold slowdown somewhere. It's hard
to get Clojure to run that slow *without* reflection, unless you're hitting
one of those cases where parallelizing actually makes things worse. Hmm;
core.async will be trying to multithread your code, even while the nature
of the task is limiting it to effectively serial performance anyway due to
blocking. Perhaps you're getting some of the slowdown from context switches
that aren't buying you anything for what they cost? The GIL-afflicted
Python code wouldn't be impacted by the cost of context switches, by
contrast.

-- 
-- 
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.

Reply via email to