Recent

Author Topic: Speedup Lazarus's recompiling  (Read 2300 times)

x2nie

  • Hero Member
  • *****
  • Posts: 515
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Speedup Lazarus's recompiling
« on: May 24, 2018, 07:52:05 pm »
Hi all,


I have a brilliant simple idea to reduce the time of (re)compiling the Lazarus. :-*


The idea is based the fact that Lazarus (application) has unique condition when compared to any application generated by it.
Uniqueness of Lazarus.exe:
* Always distributed with source code. (only lazarus.exe is almost useless)
* Always distributed with the needed resource files  (*.lfm, *.png, *.ico, *.po, etc.)


So, rather than plugging the whole tons of resource  (that I think slowdown the compile time),
can we skip that and just load them when Lazarus being started ?


The trick (that IMO brilliant) is to simply tell compiler with something like {$define let_resource_unplug}
so the application being built (lazarus.exe) will switch to new behavior: load resource {$R *.lfm} from disk instead of from exe stream (HINSTANCE) it self.






I hope it speed up Lazarus? 8-) O:-)
When you were logged in, you can see attachments.
Lazarus Github @ UbuntuCinnamon-v22.04.1 + LinuxMintDebianEdition5

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9754
  • Debugger - SynEdit - and more
    • wiki
Re: Speedup Lazarus's recompiling
« Reply #1 on: May 24, 2018, 08:21:55 pm »
I doubt the resources make a big difference.

But if it does, there is a risk it makes things worse. The IDE might end up taking more time to start. I rather wait once for compilation, than every time for startup.

----------------------

One thing that you can actually do: Disable debug info.
Specify  -g-  under Tools > Configure Build Lazarus

Be aware, if you debug your app, you can no longer step into the LCL. (And may otherwise be affected.

-------------------
The other speed improvement is to improve parallel compilation.

On my PC, it takes less time to compile all default installed packages, than it takes to build the final IDE code (folder ide).

The reason is that most of the packages compile in parallel. (if your cpu has enough cores).
However the units in the ide folder, can only compile one after another.

So if someone would volunteer to work on moving ide code into packages... (within sensible limits), then that might help.


piGrimm

  • Guest
Re: Speedup Lazarus's recompiling
« Reply #2 on: May 26, 2018, 07:16:02 pm »
I dont know on linux, but on windows I installed AMD Ramdisk, (dataram Ramdisk) and my lazarus install lies on a 8Gb Ram drive (saved and reloaded on a disk image at winows end/start)

SO I ignore compile speed problem with my installed laz on my RAM disk
« Last Edit: May 26, 2018, 07:19:26 pm by piGrimm »

mattias

  • Administrator
  • Full Member
  • *
  • Posts: 184
    • http://www.lazarus.freepascal.org
Re: Speedup Lazarus's recompiling
« Reply #3 on: May 28, 2018, 02:07:24 pm »
So, rather than plugging the whole tons of resource  (that I think slowdown the compile time),
can we skip that and just load them when Lazarus being started ?
The trick (that IMO brilliant) is to simply tell compiler with something like {$define let_resource_unplug}
so the application being built (lazarus.exe) will switch to new behavior: load resource {$R *.lfm} from disk instead of from exe stream (HINSTANCE) it self.

Nice idea. But:

Compiling the IDE with $R directives:
0m16.792s

Compiling the IDE without $R directives:
0m16.656s

piGrimm

  • Guest
Re: Speedup Lazarus's recompiling
« Reply #4 on: May 30, 2018, 10:36:26 pm »
less than 5s on ramdisk with ram speed 2.4Ghz and intel I7

8GB ram disk from 32GB total ram
« Last Edit: May 30, 2018, 10:38:59 pm by piGrimm »

 

TinyPortal © 2005-2018