Jump to content
Berocoder

Optimization On or Off ?

Recommended Posts

In our big ERP application we have always compiled it with Optimization off in compiler settings to production.

Delphi 10.4 is used but plan is to switch to 11.3 during summer.

With our biggest customer the volumes has increased and the application can sometimes feel slow.

 

So I tried to compile it with Optimization on as that is a cheap way to increase performance. Everything seems to work fine.

But there is one thing. Exceptions are logged to a textfile. Callstack/Stacktrace are also logged. We use JCL for that.

It works fine before but now I see sometimes callstacks make no sense anymore.
Obviously I suspect Optimization for that.

 

So curious how other developers handle this case ?

Is there other components like EurekaLog that handle optimization better and still can generate a reliable callstack ?

Or maybe we have to choose between better performance or reliable callstack ?
 

Regards

Roland Bengtsson

Edited by Berocoder

Share this post


Link to post
5 hours ago, Berocoder said:

But there is one thing. Exceptions are logged to a textfile. Callstack/Stacktrace are also logged. We use JCL for that.

It works fine before but now I see sometimes callstacks make no sense anymore.

1. Have not used JCL for that, but I would guess Map file is needed, make sure that mapfile if from correct build and/or updated.

2. Do you see measurable speed increase with Optimizations on?

 

-Tee-

Edited by Tommi Prami
Typo

Share this post


Link to post

Hard to tell without examples. Call stacks could vary for inlined functions but how optimization could cause difference?

Share this post


Link to post
2 hours ago, Tommi Prami said:

make sure that mapfile if from coirrect build and/or updated.

I second that. Make absolutely sure your mapfile is up to date and it is built at all. Not sure if you just toggled compiler optimisations, or switched from "Debug" to "Release" preset. I think (might be wrong) that by default, the "Release" preset doesn't even create a map file.

Share this post


Link to post
19 minutes ago, Der schöne Günther said:

I think (might be wrong) that by default, the "Release" preset doesn't even create a map file.

None of configurations create a map file by default.

  • Like 1

Share this post


Link to post
4 hours ago, Berocoder said:

Obviously I suspect Optimization for that.

My guess would be ASLR, see discussion in this thread:

 

Share this post


Link to post
5 hours ago, Berocoder said:

So I tried to compile it with Optimization on as that is a cheap way to increase performance.

I'm surprised that something like ERP would benefit much from that. Do you have any numbers?

 

Apart from that, like David, I have good experience with madExcept: No problems with optimization being on.

  • Like 2

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×