[lug] Huge stack size--any reason to avoid?

D. Stimits stimits at comcast.net
Wed Oct 18 21:40:09 MDT 2006


...

>
> So, if the stack usage is reasonable as such, I'd keep it that way. 
> Stimit's method of user managed heap is a great way to consolidate the 
> overhead of multiple OS calls and results in a huge performance boost 
> if there are a billion new/deletes, but keeping the objects on the 
> stack does the same thing if it makes sense to do so in the program.

...

There are actually some other minor differences between stack and heap, 
especially in c++, if exceptions are enabled. That being the exception 
mechanism for stack unwind...exceptions would suffer quite a bit to 
unwind such a stack, whereas smaller values that might fit in a cache 
line would be quite fast. If you also add debug symbols with stack 
frames, I would bet on the debugger itself running much slower. Who 
knows, maybe exceptions are using purely pointers and might not be 
effected by large objects in general.

D. Stimits, stimits AT comcast DOT net



More information about the LUG mailing list