This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-10-25
Channels
- # aws (1)
- # beginners (6)
- # boot (403)
- # boulder-clojurians (1)
- # clojure (28)
- # clojure-china (1)
- # clojure-ecuador (2)
- # clojure-ukraine (2)
- # clojurescript (27)
- # clojurex (5)
- # core-async (7)
- # cursive (5)
- # datomic (4)
- # hoplon (160)
- # ldnclj (2)
- # ldnproclodo (2)
- # lein-figwheel (2)
- # om (182)
- # onyx (1)
- # re-frame (1)
- # reagent (40)
- # spacemacs (15)
Hi, I'm working through Clojure for the brave and true... I had the darnedest time implementing my own version of comp. I did finally get it working a couple of different ways. My recursive implementation is faster than my implementation that uses recur... I imagine there is an idomatic way of deferring logic until you reach the end of your "recursion" and then compute as things unwind... Is this an appropriate place to ask questions about what is going on?
I have been measuring times in a REPL. I was just reading some about Clojure performance and one commenter suggested that it's probably not super smart to (time) stuff in a REPL... I'll try running some timings using lein. I'm also interested if there is an common way to use (recur) and defer computation until things unwind (maybe the point of recur is you can't do this?) More likely I'm just not getting the functional way of thinking yet.
@binduwavell: this is an appropriate place, but it might be a bit slow on weekends. Timing stuff with lein repl
is not recommended as it uses some jvm flags that optimize start time vs performance. I've seen many references to https://github.com/hugoduncan/criterium if benchmarking is important
@binduwavell: as far as delaying computation, it will depend on exactly what you're doing. Wrapping things in a fn
can delay them until the function is called. lazy-seq
is useful to delay computation for a sequence of items
Thanks @xeqi, I'll check criterium. If I want to post some sample code, is there a "proper" way of doing that here?