Software Archive
Read-only legacy content
17061 Discussions

Setting optimal stack size (to Steve Lionel)

hbell
Beginner
246 Views
In studying Steve's champion benchmark performance on Polyhedron's web site (http://www.polyhedron.com/compare/win32/f90bench_p3.html) I was struck by the enormous stack limits that need to be specified sometimes in order to optimize speed (64MB). I wonder if Steve might shed some light on how we can go about choosing the best stack size setting.
Also, if the best stack size is largely a function of the target system physical memory and the EXE non-stack requirements then perhaps stack size might be optimized and written after linking to the EXE header (eg. during the course of an installation process). Microsoft used to have an application EXEMOD that could revise EXE header parameters, but perhaps Win32 is more complex in this respect.
0 Kudos
1 Reply
Steven_L_Intel1
Employee
246 Views
First of all, it's not my performance - it's the performance of the product for which I'm just one of many engineers.

The stack size setting has nothing to do with performance. You need only enough stack to accomodate the stack-allocated variables in your particular program. Polyhedron uses just one switch combination for all programs, so if one needed a larger stack, then all programs were given the larger stack. If you have too small a stack, you'll get a run-time stack overflow error. If you have enough stack, the program runs at the same speed, no matter how much stack you allocate.

Steve
0 Kudos
Reply