Pelles C forum

C language => Expert questions => Topic started by: Kempelen on April 16, 2008, 10:18:13 PM

Title: Question to Pelle
Post by: Kempelen on April 16, 2008, 10:18:13 PM
Hi Pelle,
I am writting a program where speed is a priority. I have two questions, as the answers are not in the documentation:
- If I put 'try' and 'except' in my code, does the code inside suffer a speed penalty?
- When compile and link with debug options on, does it affect to speed of execution?

And talking of another think, if you have read my entry in the 'bug report' forum, you will see a problem. I have reproducced the code in a very small program. If you are interesting I can prepare a clean example and send you the problem an the description. if you are interesting let me know and I will send you by private message.

Regards, and thx.
FS
Title: Re: Question to Pelle
Post by: severach on April 17, 2008, 05:27:31 AM
All of the answers are in the debugger. Run to a breakpoint placed near the code in question, right click, and show assembly. You'll see the instructions for try except and any added code due to debug.
Title: Re: Question to Pelle
Post by: Pelle on April 20, 2008, 04:17:25 PM
Quote from: Kempelen on April 16, 2008, 10:18:13 PM
- If I put 'try' and 'except' in my code, does the code inside suffer a speed penalty?
Usually yes. Less so on X64 and ARM, more so on X86.

Quote from: Kempelen on April 16, 2008, 10:18:13 PM
- When compile and link with debug options on, does it affect to speed of execution?
Not much, if you keep optimizations on (but then again, debug builds are for catching bugs and not necessarily producing the fastest executables).

Quote from: Kempelen on April 16, 2008, 10:18:13 PM
And talking of another think, if you have read my entry in the 'bug report' forum, you will see a problem. I have reproducced the code in a very small program. If you are interesting I can prepare a clean example and send you the problem an the description. if you are interesting let me know and I will send you by private message.
Yes, a small example would be helpful. Please mail me...