Re: vector of chars vs string

2016-05-28 Thread Camilo Roca
@alex-miller thanks, that explained a lot. I did check the UseStringDeduplication feature and that's exactly what I was looking for. Funny thing is that it can only be implemented because strings are *immutable *in Java :P thus it is cheaper to store a reference to it since it will never change

vector of chars vs string

2016-05-27 Thread Camilo Roca
Hey guys, First of all I would like to ask some thing. In clojure the following statements results in: (identical? "foo" (str "f" "oo")) ;;=> false > (= "foo" (str "f" "oo")) ;;=> true Everything is ok with that. The next one on the other hand is what puzzles me: (identical? \f (first (str "f"

Re: is reduce/reduced faster than loop/recur?

2016-04-29 Thread Camilo Roca
puzzler, No, Clojure actually has quite a lot of protocols for reducing "things". But they are so many that I got lost in which does what and how, so I wanted a clarification on the subject. Alex miller, excellent answer already gave me some overview of the topic. Here is a link to Clojure's p

Re: is reduce/reduced faster than loop/recur?

2016-04-29 Thread Camilo Roca
ecoupled from the > reduction part, so they offer a mechanism that chooses the optimal > iteration strategy for the collection that is passed in. > > On Fri, Apr 29, 2016 at 12:46 PM, Camilo Roca > wrote: > >> >> I have been hearing a lot of Clojure's use of an

which GC optimizations work better with Clojure?

2016-04-29 Thread Camilo Roca
Following this thread: http://stackoverflow.com/questions/16695874/why-does-the-jvm-full-gc-need-to-stop-the-world I was wondering if anybody has some experience regarding GC optimizations that would work better for Clojure than the default: stop-the-world approach. My point being that given C

is reduce/reduced faster than loop/recur?

2016-04-29 Thread Camilo Roca
I have been hearing a lot of Clojure's use of an internalReduce protocol, which seems to speed up things when using reduce. Now the thing is that a lot of people also claim that tail-call-recursion is also pretty fast, which lets me wondering: - if I could replace a loop/recur with an equivalen

core.reducers documentation issue

2016-04-13 Thread Camilo Roca
Hey guys, I just wanted to mention some issue with the current documentation of core.reducers. I wanted to do it in github but it seems it is not possible there. Hopefully somebody from the language team can open an issue and correct (improve) it. There are actually two issues that I would li