Forum > FPC development

Compiling/linking speed still not on par with Delphi

(1/3) > >>

tk:
Found this thread:
http://forum.lazarus.freepascal.org/index.php/topic,958.0.html

Is there any development progress in this regard?
At least on Win?
Is the only reason that prevents us to switch to Lazarus entirely...


Windsurfer:
I could not follow your link. However this link suggests that  later versions of Delphi are similar to Lasarus http://forum.lazarus.freepascal.org/index.php/topic,20397.msg117666.html?PHPSESSID=720c0e988e3a8f488d0aaf467523aa09#msg117666

I suggest that if you have plenty of RAM, you search the forum. One post by CaptBill suggests 11 seconds for a complete IDE rebuild using IMDisk on Windows. A further web search will show how to set up ramdisk use in Linux.

Bram71:
I'm on linux and use a tmpfs (ramdrive on win) folder to store all unit output files e.d. (-FU option in project).

Put the line below in /etc/fstab and use /tmp as this folder.

tmpfs   /var/tmp   tmpfs   defaults,noatime,mode=1777   0   0

After that issue a mount -a and your good to go...

v.denis:

--- Quote ---Compiling/linking speed still not on par with Delphi
--- End quote ---

I can just share my observations.

As I know FPC already able to create PE/COFF images.

Delphi linking is fast because it just glue all DCUs into final executable.
It uses buffered stream to write so no big disk overhead.

If you link with run-time packages, it's even faster.

I don't know how it's done in FPC (i.e. maybe there are LTOs - Link Time Optimizations, which take time).
Maybe some FPC member has some benchmarks.

One more thing making run slower (time from pressing F9 to app launch):
When building done, debugger started. GDB for some reason start slowly. I don't know why, but I guess it parses debug info.

Martin_fr:

--- Quote from: v.denis on March 04, 2015, 01:37:10 pm ---One more thing making run slower (time from pressing F9 to app launch):
When building done, debugger started. GDB for some reason start slowly. I don't know why, but I guess it parses debug info.

--- End quote ---

GDB launch time is indeed noticeable.  It has many reasons.
Not sure if gdb is slower than Delphi scanning the debug info. But on Windows the most stable is gdb 7.2 (though idf you have win 7 and up, you may need 7.7.1 / avail on our sourceforge site). Newer gdb versions are a few percent faster at startup, dbut they introduce many other issues. So I do not recommend them.

GDB may be a fraction faster if you set  "DisableLoadSymbolsForLibraries" to "True"
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#internal-error:_clear_dangling_display_expressions

Another speed issue with using gdb is that the IDE needs to communicate with gdb sending and receiving commands/responses via stdin/stdout of gdb. That is not very fast either.


In Lazarus 1.4 you can install fpdebug (beta) and that will be a bit faster.

---
Still if your app is so big that it takes really long to compile, I recommend not to compile it all the time. Develop your code using a testcase, keep that small, and it will build and run in no time at all.
Not only is it faster, it is also easier to get the code stable, and working.

Navigation

[0] Message Index

[#] Next page

Go to full version