Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28597 Discussions

Performance and the -traceback compiler option

albert
Beginner
1,223 Views
I wonder if the compilation of source code with the -tracback compiler option has a performance penalty. I read that in case of the windows compiler (by head V6.6c) this was not the case.
Does anyone have any information about this.

Thanks in advance

Albert
0 Kudos
3 Replies
Ron_Green
Moderator
1,223 Views
Quoting - albert
I wonder if the compilation of source code with the -tracback compiler option has a performance penalty. I read that in case of the windows compiler (by head V6.6c) this was not the case.
Does anyone have any information about this.

Thanks in advance

Albert

-traceback by itself should have no performance impact. If you are familiar with coding in C and have written a signal handler you will understand: -traceback causes exception handler code is inserted. When an exception occurs, a signal is raised and the signal handler is called, in this case the Intel Fortran traceback handler. This code then unwinds the stack. So you see, nothing is done until the exception signal is thrown. However, note that a little more code is linked into your exe (use 'size' on the exec to see the difference - it's on the order of around 100bytes in teh TEXT segment)

HOWEVER, -traceback is pretty useless without -g. -g adds symbolic information and this will cause a larger .exe. This may affect the instruction cache and hence performance. Again, I would not expect a very large performance hit: probably in the low single digits in percentage, but this may vary by application.

WARNING -g implies -O0, so make sure that if you use -g you also use -O2 or -O3 to override the default of -O0.

The best: try with and without -g -traceback at -O2 and see what you see. I am curious about this topic so I'd be interested if you find anything more than about a 3% performance hit.

ron

0 Kudos
albert
Beginner
1,223 Views
Quoting - albert
I wonder if the compilation of source code with the -tracback compiler option has a performance penalty. I read that in case of the windows compiler (by head V6.6c) this was not the case.
Does anyone have any information about this.

Thanks in advance

Albert

-traceback by itself should have no performance impact. If you are familiar with coding in C and have written a signal handler you will understand: -traceback causes exception handler code is inserted. When an exception occurs, a signal is raised and the signal handler is called, in this case the Intel Fortran traceback handler. This code then unwinds the stack. So you see, nothing is done until the exception signal is thrown. However, note that a little more code is linked into your exe (use 'size' on the exec to see the difference - it's on the order of around 100bytes in teh TEXT segment)

HOWEVER, -traceback is pretty useless without -g. -g adds symbolic information and this will cause a larger .exe. This may affect the instruction cache and hence performance. Again, I would not expect a very large performance hit: probably in the low single digits in percentage, but this may vary by application.

WARNING -g implies -O0, so make sure that if you use -g you also use -O2 or -O3 to override the default of -O0.

The best: try with and without -g -traceback at -O2 and see what you see. I am curious about this topic so I'd be interested if you find anything more than about a 3% performance hit.

ron



I've got a small test program in which I use the subroutine tracebackqq.
I've run my small test program with -g and -traceback and only with -traceback and I see no differences in the stack trace.
(see files in attached tar file)

Albert

0 Kudos
Steven_L_Intel1
Employee
1,223 Views
Actually, the traceback is not dependent on debug information. It is separate data in the executable. As Ron says, other than the exception handler which is always there for Fortran applications, there is no run-time overhead for traceback other than the space used in the executable for the information.
0 Kudos
Reply