Re: Question: defrecord accessor efficiency without protocols

2014-05-16 Thread László Török
Hi, afaik the Clojure compiler will compile such calls to a direct field access, i.e. the fastest possible. This will happen whenever the compiler can infer the type information. You can facilitate this by using type hints if necessary. Regards, Las 2014-05-16 15:44 GMT+01:00 Dave Tenny : > (d

Question: defrecord accessor efficiency without protocols

2014-05-16 Thread Dave Tenny
(defrecord Foo [bar]) (:bar (Foo. 1)) Is clojure smart enough to make the :bar lookup O(1) as a known field of Foo? Or is it still a map-like O(logN) lookup? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clo