|
|
Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> http://www.iecc.com/gclist/GC-faq.html
>
> "Most allocated objects have short lifetimes."
>
> Hmm, that may be so with languages which force you to allocate everything
> on the heap (ie. things which potentially have longer lifetimes than
> stack-allocated local objects).
And if it's not on the heap, but on the stack instead, it *still* has a
pretty short lifetime. :-)
> Personally I seldom find myself allocating memory dynamically for short
> periods of time in time-critical parts of the program, when coding in C++.
> Most short-lived objects and variables can usually be handled on the stack.
Yep. And a lot of languages are smart enough to figure that out
automatically. Not Java as initially implemented.
One of the advantages of letting the compiler handle stuff like this for
you is that the compiler can get smarter.
> That's a bit surprising of a result, but might be explainable by
> cache behavior or something similar.
Yeah, or better addressing modes maybe?
--
Darren New / San Diego, CA, USA (PST)
"That's pretty. Where's that?"
"It's the Age of Channelwood."
"We should go there on vacation some time."
Post a reply to this message
|
|