Why do debug symbols so adversely affect the performance of threaded applications on Linux?

Posted by fluffels on Stack Overflow See other posts from Stack Overflow or by fluffels
Published on 2010-05-21T06:33:28Z Indexed on 2010/05/21 6:40 UTC
Read the original article Hit count: 182

Filed under:
|
|
|
|

Hi.

I'm writing a ray tracer.

Recently, I added threading to the program to exploit the additional cores on my i5 Quad Core.

In a weird turn of events the debug version of the application is now running slower, but the optimized build is running faster than before I added threading.

I'm passing the "-g -pg" flags to gcc for the debug build and the "-O3" flag for the optimized build.

Host system: Ubuntu Linux 10.4 AMD64.

I know that debug symbols add significant overhead to the program, but the relative performance has always been maintained. I.e. a faster algorithm will always run faster in both debug and optimization builds.

Any idea why I'm seeing this behavior?

© Stack Overflow or respective owner

Related posts about Performance

Related posts about gprof