Thanks for your replies.
Sean: Type-hinting the String didn't help. And for some reason, defn'd
function is 1.5x slower than my anonymous one.
Daniel: Thanks for the info. Once my algorithms are fine (if they can
get finer), I'll definitely narrow down the zips5 seed, and use your
suggested MD5 digester.
Stuart:
user> (time (dorun (take 1000000 (for [x (range 99999), y (range
9999)]
(format "%05d-%04d" x y)))))
"Elapsed time: 95470.891 msecs"
:( That's probably because my version makes sure 'format' is called
only when there's a need for padding with leading zeros.
All:
I forgot to mention that the only function I need to optimize at this
point is 'all-zips' (sorry), because 'zip-formatted-range' is
instantaneous, and 'all-zips-MD5's performance depends solely on the
MD5 digester used and 'all-zips'. My bottleneck is thus definitely
'all-zips'.
Do you think this code should run as "slow" in a purely imperative,
traditional Java solution? Is there something functional I should
sacrifice for bloated iterative code?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---