Stack analysis is quite a brittle mechanism, as far as I'm aware of. As 
soon as you pass the object to any method, even if private, the object will 
not be stack-allocated. The way Clojure code is typically written, and the 
way it is compiled, some method call will almost certainly get involved.

On Saturday, February 23, 2013 9:14:12 PM UTC+1, Nicolas Oury wrote:
>
> On Fri, Feb 22, 2013 at 8:01 PM, Marko Topolnik 
> <marko.t...@gmail.com<javascript:>
> > wrote:
>
>>
>> Forgot to mention another hugely important factor: heap-allocated objects 
>> spell disaster for CPU cachelines. With today's architectures the 
>> difference between a cache hit and a cache miss is like the difference 
>> between catching your bus to work and having to walk instead. In our 
>> example I would have to be careful to reuse the same deftype instance for 
>> all inner loop runs, but then I'd need even more code to make sure the 
>> values are reset before entering. The result would be messy, brittle code 
>> with higher-level logic scattered between all the housekeeping constructs.
>>
>>
>
>  Wouldn't the object be stack allocated by escape analysis?
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to