Forum > Unix

Free Pascal takes about minute to compile a helloworld (64-bit Debian Stretch)

(1/2) > >>

geek893:
OS: 64-bit Debian Stretch. When I was on 32-bit Debian Jessie there wasn't such problem, compilation was fast. The hardware is the same as before. The same goes for compilation command. Compilation command: fpc filename.pas -g -Cr. My systems is mixed, it allow execution and installation of both 32-bit and 64-bit applications. It seems that 99% of time takes linking. It seems that other languages (like C) aren't affected by such problem. Compilation of *.lpr files in Lazarus works fine.

This code took 52 second to compile:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---BEGINwrite('Hello, cruel world!');END.

Jonas Maebe:
If you compile with -vas, the compiler will show everything it does and prefix every message with a timestamp. That should allow you to get a better idea about what is taking so long.

Thaddy:

--- Quote from: geek893 on June 29, 2018, 05:40:59 pm ---OS: 64-bit Debian Stretch. When I was on 32-bit Debian Jessie there wasn't such problem, compilation was fast. The hardware is the same as before. The same goes for compilation command. Compilation command: fpc filename.pas -g -Cr. My systems is mixed, it allow execution and installation of both 32-bit and 64-bit applications. It seems that 99% of time takes linking. It seems that other languages (like C) aren't affected by such problem. Compilation of *.lpr files in Lazarus works fine.

This code took 52 second to compile:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---BEGINwrite('Hello, cruel world!');END.
--- End quote ---
You must have something criminally wrong because it compiles on a humble RPi in less than  0.1

geek893:

--- Quote ---That should allow you to get a better idea about what is taking so long.
--- End quote ---
Thanks for the idea. Does it work by principle "do a thing and only then report that you did it?". If yes, then it's all fault of "[0.156] Linking helloworld" step. Everything else works momentally.  Although I said already that it's linking that slows everything down.

Jonas Maebe:
The compiler usually first writes what it is going to do and only then does it. To really be sure it's the linking step, you could compile with -Cn and then execute the generated ppas.sh. That shell script will then just execute the linking step.

If that's the issue, please report a bug against binutils at https://sourceware.org/bugzilla/ (compile with -Cn, and include all FPC-related files referenced from the generated ppas.sh and link.res)

Navigation

[0] Message Index

[#] Next page

Go to full version