Recent

Author Topic: How to speed things sup?  (Read 9849 times)

HatForCat

  • Sr. Member
  • ****
  • Posts: 293
How to speed things sup?
« on: March 26, 2013, 04:32:25 pm »
Hi,

I am just getting started with Lazarus and really like what I see. I have been programming for a looong time, way before Delphi and have been a Delphi fan from v1.0 up to D2007. Nuff said.

Yesterday I got started with Lazarus, Zeos and SQLite and I am re-writing an application I wrote in Delphi v5pro. The compile and linking times are waaaay longer in Lazarus so I did some searching and did not find anything to help much, so the questions are.

Is there a list of recommended options for speed that still includes the Debug processes? I am a mere human and Debug is mandatory during development! :)

Would Lazarus work faster on a Linux platform? I am happy to have a dual boot process. I use a Laptop with win7pro, i7, SSD, 8GB etc and all the speed trimmings, but even D5 is three+ times faster to run an app in the IDE than Lazarus!

I am not complaining, I just want to get it optimized for compile, link and run speed. Even if I have to build a new all-in-one platform for it, I am OK with that. I am retired and like tinkering and ya cain't have too many toys. :D

Thanks
Acer-i5, 2.6GHz, 6GB, 500GB-SSD, Mint-19.3, Cinnamon Desktop, Lazarus 2.0.6, SQLite3

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9874
  • Debugger - SynEdit - and more
    • wiki
Re: How to speed things sup?
« Reply #1 on: March 26, 2013, 05:01:36 pm »
Recommended settings for debugging: http://wiki.lazarus.freepascal.org/Debugger_Setup

There is not to much that can be done to speed it up. However: Definitely avoid smart linking. That costs quite some time.

If you do not need to step into units in packages, then recompile those packages without debug info. This reduces the total amount of debug info.

Otherwise I have no idea.

Usually it is only the first build, then only units that changed (and those that depend on them) will recompile.
Linking does take a bit too. Especially if you are low on memory.

pierre.se.pos

  • New Member
  • *
  • Posts: 17
Re: How to speed things sup?
« Reply #2 on: March 26, 2013, 05:08:28 pm »
Hi,

I have the same problem and could not find any answers on how to make the software faster. I tried to solve the problem by getting a faster computer. This did not really help, here is more info on the problem http://www.extremetech.com/computing/134760-pc-obsolescence-is-obsolete.

The next problem that I see is that CPU's is moving toward many cores, the only way to make a PC faster is to write programs that will execute on many cores in parallel (not threads). What is needed is a compiler that would analize a program and automatically identify and translate the parts that can be parallellized.

Lazarus do not have this technology. However it is available and in development
http://llvm.org/
http://blog.llvm.org/ (NVIDIA CUDA 4.1 Compiler Now Built on LLVM)
https://sites.google.com/site/parallelizationforllvm/

Some gifted people is working on an LLVM implementation for pascal
http://code.google.com/p/llvm-pascal/

Even Embarcadero is working on using LLVM as Delphi compiler
https://forums.embarcadero.com/thread.jspa?threadID=73703
http://robstechcorner.blogspot.com/2012/07/embarcadero-clang-and-llvm.html






Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9874
  • Debugger - SynEdit - and more
    • wiki
Re: How to speed things sup?
« Reply #3 on: March 26, 2013, 05:13:49 pm »
The OP was (as far as I understand) about the time it takes to compile. Not about the time that the code takes to execute (once it is running).

Of course, since FPC is compiled with FPC, the latter affects the former.

pierre.se.pos

  • New Member
  • *
  • Posts: 17
Re: How to speed things sup?
« Reply #4 on: March 26, 2013, 05:24:28 pm »
Hi

Please note that LLVM's compiler speed is compared with gcc (its compilation speed typically better than GCC's http://en.wikipedia.org/wiki/Clang

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How to speed things sup?
« Reply #5 on: March 26, 2013, 05:31:32 pm »
Quote
Would Lazarus work faster on a Linux platform?
For me, yes (for a big magnitude). Mostly due to absence of antivirus software though, despite Linux process scheduler is also better for compilation.
Quote
but even D5 is three+ times faster to run an app in the IDE than Lazarus!
Lazarus is using 3rd party debugger, which it has no control. GDB is indeed slow, but it works quite well.
Quote
Please note that LLVM's compiler speed is compared with gcc (its compilation speed typically better than GCC's http://en.wikipedia.org/wiki/Clang
And...so?

HatForCat

  • Sr. Member
  • ****
  • Posts: 293
Re: How to speed things sup?
« Reply #6 on: March 26, 2013, 06:37:38 pm »
Thanks for all the replies.

I will install Mint and see what's what -- if anything. Although, I doubt the anti-virus etc is getting in the way. I will try disabling Firewall and Security Essentials.

I guess it is the debugger dragging things down then.

I will experiment.

@Pierre: Bummer about a faster computer, just when I could use a new toy to platy with. :D
Acer-i5, 2.6GHz, 6GB, 500GB-SSD, Mint-19.3, Cinnamon Desktop, Lazarus 2.0.6, SQLite3

Chronos

  • Full Member
  • ***
  • Posts: 241
    • PascalClassLibrary
Re: How to speed things sup?
« Reply #7 on: March 26, 2013, 07:32:47 pm »
- I suggest to use multicore cpu, Windows with SSD disk installed and compression set on project folder. Compression will not do much load of cpu but still speed up file access mainly during linking and debugging info producing.
- Make sure you have set NtfsDisableLastAccessUpdate  http://www.howtogeek.com/howto/windows/speed-up-disk-access-by-disabling-last-access-updating-in-windows-xp/
or fs noatime attribute in case of linux
- ramdisk could help but it is not practical as SSD with newer SATA could handle up to 600 MB/s

- Yes, multithreaded compilation is just another FPC missing feature what would help significantly on multicore cpus like AMD FX-8350 eight-core Processor @ 4.0 GHz or some Tilera TILE-Gx8072 72-core @ 1.2 GHz
- Native debbuger will be helpfull. It would be really good to be able to reduce significantly debugging info size. Maybe somehow should look how Delphi handle this so fast.
- If you hit F9 key for Run application, you could observe that manytimes application is linked repeatedly even if no code is changed at all. And linking for example 50 MB debug info simply cannot be as fast as for example 5 MB.
- there was some discussion about also compilation messages could slow down process

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: How to speed things sup?
« Reply #8 on: March 27, 2013, 07:17:44 am »
Quote
Although, I doubt the anti-virus etc is getting in the way
It is. I have experiences with different anti-viruses, the worst being f-secure used in my office. Avira is not that bad, so is security essential (still, they slow things down a bit). Everytime the compiler, make, rm, whatever utilities run, the anti-virus will attempt to check it, again n again without caching. Thus, compiling the IDE from source takes quite some time (10 minutes or so). At home, it usually only take 1-2 minutes. Running the program from IDE triggers even stronger scan, perhaps due to 3 levels of execution (IDE->debugger->program) which looks suspicious.

pierre.se.pos

  • New Member
  • *
  • Posts: 17
Re: How to speed things sup?
« Reply #9 on: March 27, 2013, 09:28:20 am »
- I suggest to use multicore cpu, Windows with SSD disk installed and compression set on project folder. Compression will not do much load of cpu but still speed up file access mainly during linking and debugging info producing.

Thank you, I will try the compression trick.

A SDD did help, I use Linux and run windows 7 in a virtual machine. I have a Debian based distribution and followed the advice at:
http://wiki.debian.org/SSDOptimization

HatForCat

  • Sr. Member
  • ****
  • Posts: 293
Re: How to speed things sup?
« Reply #10 on: March 27, 2013, 05:52:14 pm »
As I stated in the OP, I have an SSD (Samsung 840 pro and AHCI set) i7 etc.

I turned off my modem, uninstalled Security Essentials and the Comodo firewall and picked up probably two seconds in the compile and run time. Almost too hard to measure the difference, may have been my reaction time with the stop watch. :)

Delphi with the same application was just on 1/5th the time.

I was just wondering if there was anything I could do to increase the speed. Since it seems not, I will live with it.

Thanks for the comments.
Acer-i5, 2.6GHz, 6GB, 500GB-SSD, Mint-19.3, Cinnamon Desktop, Lazarus 2.0.6, SQLite3

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: How to speed things sup?
« Reply #11 on: March 28, 2013, 06:41:52 pm »
ya know, the compile times while slower than Delphi is still pretty reasonable and compares favorably to newer versions of Delphi.

If you are using Delphi 5 it is pretty fast even compared to the newer versions of Delphi but a lot of that speed is because it lacks a lot of features compared to newer versions of Delphi.

I don't think the compile times for Lazarus/FPC are that bad at all considering.

I was last on Delphi XE2 and I don't have any complaints vs compile times of Lazarus and FPC.

***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

 

TinyPortal © 2005-2018