You can control optimization level per function using #pragma opt.
Refer to Appendix B of the C++ Users Guide for details.
If you haven't done so already, review the description of -fast in the manual, and also use the -dryrun or -v option to see the actual effect of -fast on your system. The combination "-fast -g0" is a little odd, since -g0 disables some optimizations.
Also have a look at some of the technical articles on performance listed here:
http://developers.sun.com/sunstudio/articles/pp.jsp
This is the first time the product is optimized. Due to the minimal resources, I have to optimize dev as welll as prod releases. In order to study the system performance and stability, I am pushing the optimized modules in the developement env. I am getting complaints from developers that they are not able to see local variables as well as they do not want to optimize cetain code segments.
The compiled code is now debuggable and we have seen 15% improvement with performance.
I have plenty of options on the table and trying to chose the best one that fits my organization.
Thank you for pointing out that to me and thank you for your help...