Recent

Author Topic: Lazarus IDE compiling is too slow for me!!  (Read 3758 times)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4541
  • I like bugs.
Re: Lazarus IDE compiling is too slow for me!!
« Reply #30 on: February 21, 2024, 12:21:45 pm »
A very useful tool to "measure" the source code metrics is sloccount. It is claimed to support also the Pascal syntax:
https://dwheeler.com/sloccount/
In recent debians is natively available for apt installation.
It is also in Manjaro's repository. I tried "$ sloccount ." in Lazarus source directory.
It gives a long list of warnings, much longer than my Konsole buffer length.
Most are like this :
Code: [Select]
Warning: newline in string - file /home/juha/SW/lazarus/tools/svn2revisioninc.pas, line 405Line 405 in svn2revisioninc.pas is :
Code: [Select]
  // Use or's short circuiting to make sure only the last succesful function writes to RevisionStrThus the warnings are false. sloccount thinks a quote char inside a comment starts a Pascal string.
Other warnings are like this :
Code: [Select]
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "",
        LC_ALL = (unset),
        LC_ADDRESS = "fi_FI.UTF-8",
        LC_NAME = "fi_FI.UTF-8",
        LC_MONETARY = "fi_FI.UTF-8",
        LC_PAPER = "fi_FI.UTF-8",
        LC_IDENTIFICATION = "fi_FI.UTF-8",
        LC_TELEPHONE = "fi_FI.UTF-8",
        LC_MEASUREMENT = "fi_FI.UTF-8",
        LC_TIME = "fi_FI.UTF-8",
        LC_NUMERIC = "fi_FI.UTF-8",
        LANG = "fi_FI"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
sloccount is made partly with Perl. Does anybody know how to get rid or such a warning?

Finally it gives a report :
Code: [Select]
SLOC    Directory       SLOC-by-Language (Sorted)
1304278 components      pascal=1303710,sh=431,ansic=137
792887  lcl             pascal=699801,cpp=93069,sh=17
354500  ide             pascal=354500
41508   packager        pascal=41508
28463   examples        pascal=27809,java=609,sh=45
23537   designer        pascal=23537
21980   tools           pascal=19242,sh=2525,perl=213
11374   test            pascal=11292,sh=82
9872    converter       pascal=9872
6168    doceditor       pascal=6167,sh=1
1709    debugger        pascal=1709
184     docs            pascal=96,perl=84,sh=4
19      top_dir         sh=10,pascal=9
3       images          sh=3
0       install         (none)
0       languages       (none)
0       lazarus.app     (none)
0       startlazarus.app (none)
0       units           (none)

Totals grouped by language (dominant language first):
pascal:     2499252 (96.26%)
cpp:          93069 (3.58%)
sh:            3118 (0.12%)
java:           609 (0.02%)
perl:           297 (0.01%)
ansic:          137 (0.01%)


Total Physical Source Lines of Code (SLOC)                = 2,596,482
Development Effort Estimate, Person-Years (Person-Months) = 769.37 (9,232.43)
 (Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))
Schedule Estimate, Years (Months)                         = 6.69 (80.31)
 (Basic COCOMO model, Months = 2.5 * (person-months**0.38))
Estimated Average Number of Developers (Effort/Schedule)  = 114.96
Total Estimated Cost to Develop                           = $ 103,931,263
 (average salary = $56,286/year, overhead = 2.40).
SLOCCount, Copyright (C) 2001-2004 David A. Wheeler
SLOCCount is Open Source Software/Free Software, licensed under the GNU GPL.
SLOCCount comes with ABSOLUTELY NO WARRANTY, and you are welcome to
redistribute it under certain conditions as specified by the GNU GPL license;
see the documentation for details.
Please credit this data as "generated using David A. Wheeler's 'SLOCCount'."
2 and a half million lines. Cost to Develop = 104 million dollars.
Heh :)

The source is now in SourceForge apparently.
https://sourceforge.net/projects/sloccount/
Lazarus should have an IDE plugin package providing statistics like this.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

TRon

  • Hero Member
  • *****
  • Posts: 3643
Re: Lazarus IDE compiling is too slow for me!!
« Reply #31 on: February 21, 2024, 12:28:11 pm »
By reading your needs for an extreme fast compilation "server", you first need to invest, not into processor or storage, in RAM.
Bring on the big guns  :D

True in case you really require the performance but I was trying to be modest and simply put the output directory to ram. It saves a few write cycles to your NVME storage in the process.

I even code in ram (git is very helpful transferring from and to physical disk) and yes there is the occasional screw-up and you lost everything (commit plenty  ;D ) but nowadays it is rarely that I screw up that much that the machine will reboot or requires a reboot.

You could even do without storing fpc/laz into ram as long as things are relatively static. If you plan on recompiling the IDE often then it is advisable to store and rebuild the IDE in ram as well.
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

dbannon

  • Hero Member
  • *****
  • Posts: 3156
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus IDE compiling is too slow for me!!
« Reply #32 on: February 21, 2024, 12:38:27 pm »
A very useful tool to "measure" the source code metrics is sloccount....
It is also in Manjaro's repository. I tried "$ sloccount ." in Lazarus source directory.
It gives a long list of warnings, much longer than my Konsole buffer length.
...
Yes, I tried it too, same result. Also, I note it does not seem to have a "exclude dir" option, so, counts files in, eg, backup. Nonsense about "newlines in string" sound to me like its not parsing the Pascal code correctly. Incidently, it values my project at $1.5M.   %)

And another one, cloc, also written in perl, also with perl's usual user friendliness.

Sounds like we could do better.....

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Чебурашка

  • Hero Member
  • *****
  • Posts: 586
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Re: Lazarus IDE compiling is too slow for me!!
« Reply #33 on: February 21, 2024, 01:21:56 pm »
sloccount is made partly with Perl. Does anybody know how to get rid or such a warning?

Seems you are missing the LANGUAGE, in debian should be set with localectl set-locale "fi_FI:fi" or something like this

Code: Bash  [Select][+][-]
  1. root@mep-development:~# localectl --help
  2. localectl [OPTIONS...] COMMAND ...
  3.  
  4. Query or change system locale and keyboard settings.
  5.  
  6. Commands:
  7.   status                   Show current locale settings
  8.   set-locale LOCALE...     Set system locale
  9.   list-locales             Show known locales
  10.   set-keymap MAP [MAP]     Set console and X11 keyboard mappings
  11.   list-keymaps             Show known virtual console keyboard mappings
  12.   set-x11-keymap LAYOUT [MODEL [VARIANT [OPTIONS]]]
  13.                            Set X11 and console keyboard mappings
  14.   list-x11-keymap-models   Show known X11 keyboard mapping models
  15.   list-x11-keymap-layouts  Show known X11 keyboard mapping layouts
  16.   list-x11-keymap-variants [LAYOUT]
  17.                            Show known X11 keyboard mapping variants
  18.   list-x11-keymap-options  Show known X11 keyboard mapping options
  19.  
  20. Options:
  21.   -h --help                Show this help
  22.      --version             Show package version
  23.      --no-pager            Do not pipe output into a pager
  24.      --no-ask-password     Do not prompt for password
  25.   -H --host=[USER@]HOST    Operate on remote host
  26.   -M --machine=CONTAINER   Operate on local container
  27.      --no-convert          Don't convert keyboard mappings
  28.  
  29. See the localectl(1) man page for details.
  30.  
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

vfclists

  • Hero Member
  • *****
  • Posts: 1146
    • HowTos Considered Harmful?
Re: Lazarus IDE compiling is too slow for me!!
« Reply #34 on: February 21, 2024, 02:02:00 pm »

Is wc -l *.pas recursive?

No, would require some clever "find' commands if your code is in multiple directories.   :(

How about telling us how long it takes anyway ?

Davo

I will do that later with Lazbuild. Hopefully it will generate more accurate times.

Is there a way of timing each invocation of an fpc command?

I don't see any way of timing the runs unless they are invoked with the time command.

Lazarus 3.0/FPC 3.2.2

TRon

  • Hero Member
  • *****
  • Posts: 3643
Re: Lazarus IDE compiling is too slow for me!!
« Reply #35 on: February 21, 2024, 02:16:14 pm »
I don't see any way of timing the runs unless they are invoked with the time command.
Exactly that. replace your fpc executable with a batch file that times your real fpc executable.
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

dbannon

  • Hero Member
  • *****
  • Posts: 3156
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus IDE compiling is too slow for me!!
« Reply #36 on: February 22, 2024, 12:14:26 am »
Exactly that. replace your fpc executable with a batch file that times your real fpc executable.

That would give a valuable indication (ie are we talking about 5 seconds or 5 minutes ?) but not everything in the build process is fpc. Linking does a whole lot of pokeing around ...

No, if you want accurate, lazbuild is the way to go. Its dead easy, the command is there in your Lazarus tree. Just give it the name of the project you want to build and the mode from that project you want to use, the rest will almost certainly be of as defaults. But I am not sure lazbuild has a 'clean' option, so touch all your source first.

Hmm, do you use a lazarus.cfg file ?  If so, use the full path to lazbuild, it will look for the cfg file there too. If not, you may need to also tell lazbuild which config to use if not using the default.

From your project dir -
Code: [Select]
$HOME/bin/Lazarus/lazarus_3_0/lazbuild  --build-mode=release project1.lpi

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018