Forum > General

Compiled programs run slowly

<< < (2/2)

Bart:
Badly written SQL?

Bart

Josh:
If using timers, make sure that what ever they are doing in the timer can be completed before the next interval.
if unsure in the ontimer event disable the timer and enable it when the running code is finished. Similar principle for threads.

What is your CPU and Memory Doing in task manager?

Warfley:
The main reason for slow execution is most likely not bad optimization by the compiler or the tooling used, but it's most of the time simply inefficient algorithms and/or datastructures.

Everyone can just guess what might be the matter with your code, but the chances that anyone might guess correctly are pretty low. You should first see where you program is taking so long, and then see how you could optimize this. For this there are tools, so called profilers, that can measure how much time is spend in every function. See the Wiki page for further information: https://wiki.lazarus.freepascal.org/Profiling

440bx:

--- Quote from: Pe3s on January 24, 2022, 02:37:45 pm ---What could be the reason why programs run slowly?

--- End quote ---
The only way to get an accurate answer to that kind of question is to profile the program.  You do that and then you'll know where the program is spending its time.  Anything else is educated guess work at best.

Navigation

[0] Message Index

[*] Previous page

Go to full version