

Ask HN: Why is this clojure example so slow? - jacquesm

Hello HN, specifically those that have some clojure experience.<p>I've been playing around with clojure some more, specifically this tutorial:<p>http://github.com/swannodette/enlive-tutorial<p>I have a pretty fast box to play around with (I guess most of us do), but the tutorials run extremely slow, scraping HN takes a bit of time, I understand that, but then to list the items should be really fast.<p>Instead it looks like the data is coming out of a 9600 baud modem.<p>Is there any specific reason for this?
======
swannodette
I'm curious as to what you mean by slow? _Maybe_ you would see this on JVM
cold run, but after that it should be pretty darn fast.

~~~
jacquesm
It takes about 3 seconds to output the data, if I re-run it, discounting for
the reload of the page, from the start of the output to the end again about 3
seconds.

I figured this can't be normal.

~~~
swannodette
How are you running it? What machine? What JDK? On my machine it takes
milliseconds to print out the results.

Taking 3 seconds seems very odd to me.

~~~
jacquesm
By following your instructions to the letter, using

jdk1.6.0_17

The box is a lightly loaded 2.7 GHz linux machine with an i7 in it.

Really strange! I'm a complete noob when it comes to clojure though, so there
is a chance I did something wrong.

------
itistoday
Wouldn't this be better asked on the Clojure google group?

<http://groups.google.com/group/clojure>

~~~
jacquesm
The tutorial was posted here by the HN user that wrote it.

