Berocoder 14 Posted May 25, 2023 (edited) 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 May 25, 2023 by Berocoder Share this post Link to post
Tommi Prami 130 Posted May 25, 2023 (edited) 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 May 25, 2023 by Tommi Prami Typo Share this post Link to post
David Heffernan 2345 Posted May 25, 2023 I'm using madExcept and its call stacks are fine with optimisation on. Share this post Link to post
Fr0sT.Brutal 900 Posted May 25, 2023 Hard to tell without examples. Call stacks could vary for inlined functions but how optimization could cause difference? Share this post Link to post
Der schöne Günther 316 Posted May 25, 2023 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
dummzeuch 1505 Posted May 25, 2023 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. 1 Share this post Link to post
SwiftExpat 65 Posted May 25, 2023 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
Anders Melander 1782 Posted May 25, 2023 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. 2 Share this post Link to post