On 23 Oct 2013, at 15:32, David Powell <djpow...@djpowell.net> wrote:

> When you say it is spending 99% of its time in PersistentHashSet.cons, is 
> that the time spent in just that method, or the time spent in that method and 
> the methods that it calls?

The latter.

> Given that (set ...) is one of the first things called by (solve..), and that 
> its contents are produced lazily by a for comprehension, if you are looking 
> at the total time spent in PersistentHashSet.assoc, then maybe that will be 
> particularly slow.  Not that that solves the problem, but I was wondering if 
> PersistentHashSet.assoc might be a red herring.

Ah - that's entirely plausible. I have basically no experience of profiling 
Clojure, or understanding the way in which laziness affects doing so (I suspect 
that it complicates things somewhat?).

> Also, out of interest, are you using a sampling profiler, or an instrumenting 
> one?

Sampling.

> Sometimes the built-in hprof profiler is good for this sort of thing:
> 
> java -Xrunhprof:cpu=times,depth=4 -Xmx2g -jar 
> target\chess-clojure-0.1.0-SNAPSHOT-standalone.jar
> 
>   - you can use either cpu=times for instrumenting, or cpu=samples for 
> sampling.
> 
> It is nice because the depth parameter lets you find hotspots including a few 
> steps up the stacktrace (4 in this case).  And you can use Ctrl-\ / 
> Ctrl-Break / SIG_QUIT to get it to dump the current stats while the program 
> is still running to see if some methods are getting worse over time.

I've not used hprof before - I'll see if I can divine anything useful from it.

Thanks.

--
paul.butcher->msgCount++

Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?

http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: p...@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher

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