Forum > General

Lazarus IDE compiling is too slow for me!!

<< < (2/8) > >>

Bart:
On my old win10 laptop (i5 7th gen, 8GB RAM, SSD hardisk) building Lazarus clean takes < 2 minutes.

Bart

vfclists:

--- Quote from: Bart on February 20, 2024, 10:27:45 pm ---On my old win10 laptop (i5 7th gen, 8GB RAM, SSD hardisk) building Lazarus clean takes < 2 minutes.

Bart

--- End quote ---

Mine does this in less time.

Martin_fr:
OK, first I though the subject was about recompiling the IDE itself.

But you are talking about your app.

1) What OS?
2) Size of your project (number of units, average amount of lines per unit)
3) Size of the compiled exe (with debug info)
4) Do you have your own packages, do you edit files in those packages?


--- Quote --- to running program in less then 8 secs.
--- End quote ---

For reference, I am using a debug build of the IDE and FPC (tiny bit slower) and an new GUI project, takes 4 seconds from pressing F9 to run.
Another project takes 7 seconds if it has a few units to rebuild (I made changes to them). So that is very close to the 8 secs you want. It may go over that time...
(I7 8700K  but I think compared to your CPU that wont make a big diff, the speed of your ssd matters / memory you have enough.)

I have a normal Lazarus build, but that sits on a HDD, and takes 10 seconds for an new empty app. (so disk speed does matter).

If you have a big project, then the extra time needed depends.
Normally only units that were changed (or depend on those) are recompiled. So not all of your units will be recompiled each time.

You should have a look at the messages window:
1) How long does it take between pressing F9 and the green line appearing "Compile project .... Success ..."
2) During this time, how long do you see the message "Linking..."
3) How much time after that, till you app runs?


If the time happens in 1 or 2 then it depends how many units needed to be recompiled.

If 1) Do you have any mega big units? (10000 lines and more)?

If it is 2 then check if you have "Smart linking" off, you do not need that for your testing and debugging. And for larger apps it can be noticeable.
You could also remove debug info from packages like the lcl.

If it is 3 (or even if not) check you debugger backend (Menu Tools > Options > Debugger Backend).
Since you have an Intel CPU you should be using FpDebug.
If you are using GDB, well yes that takes time to start your app.

units do NOT compile in parallel, unless they are in different packages.

But I wouldn't worry about that, unless you got more than a dozen units that need to be compiled for each run (because they all were changed, or are using a unit that were changed / but if the are using a unit that was changed, they all need to wait for that one)


You can rebuild both fpc and Lazarus with -O4 => but it will probably give between 3 and 5% only. (Assuming you already have them at -O2 which is default)

The IDE may be prebuild with -gh heaptrc (not sure), you could rebuild it with -gh- => might help another little bit (if it was with gh).

Martin_fr:

--- Quote from: vfclists on February 20, 2024, 10:26:52 pm ---
--- Quote from: Curt Carpenter on February 20, 2024, 10:16:16 pm ---Could you provide some actual times and file sizes?  (I'm only curious.  I use a pretty old 32bit machine on Linux and it has always seemed very fast with Lazarus.  Even rebuilding after adding a new package  only takes a minute or two.)

--- End quote ---

I think there is a dialog which provides this information but I can't remember what it is and it may not be present in the menus.

Do you know what it is or whether it requires an additional package to be installed?

--- End quote ---

That dialog has long been abandoned.

vfclists:
Does anyone have some experience profiling Lazarus/FPC with the kind of tools that can generate a flamegraph?

I don't know whether Lazarus has to be built with support for profiling, or it is the tool themselves that run the projects make commands and analyze their performance.

After you have done your editing and are ready to compile, what is the command actually run to build the application? I'm sure it is quite simple and I've seen it somewhere before. I just can't recollect what it is.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version