To be fair, "(time (map identity (range 0 99)))" -> 0.037 msecs, "(time (doall (map identity (range 0 99))))" -> 0.13 msecs. :)
For people who don't know Clojure, the reason this is a critical difference is because Clojure's map function is "lazy", in that it simply instantaneously returns an object which, if you attempt to iterate on it, only then attempts to execute the code involved.
To make this more concrete, if I take the former expression, and make it go to 1000, or 10000, or 10000000000000, it seriously takes the same amount of time on my system. By passing the result to doall you are forcing the entire seq to be iterated and executed.
Re:The IDE as a value
by disgruntledphd2 on Saturday January 26, 2013 @12:30PM
(#5120997)
Ah, I had a feeling I was missing something. I probably should have realised laziness had something to do with it. I'll have to keep that in mind in the future. Thanks for the information, its greatly appreciated.
On my machine, at least (map identity (range 0 99)) takes 0.046072 milliseconds, which is somewhat less than 16 milliseconds. Now, maybe there's something I'm missing here, can you clarify the source of your assertion?
Again, definitely not trying to be confrontational, and I don't know clojure very well, nor do I know anything about games programming, but that was what I found on my i3 core with nrepl running in emacs 24.
On topic, I think that the architecture proposed sounds really interesting (as does much of Light Table).