Recent

Author Topic: compiling/building takes over 1 minute  (Read 11016 times)

ciuly

  • New Member
  • *
  • Posts: 47
  • Delphi/C# developer
    • Ciuly's Web Corner
compiling/building takes over 1 minute
« on: November 04, 2007, 05:14:02 pm »
(I'm woking on a Win XP SP2 running on a vmware 6 workstation virtual machine configured with 1 GB ram, 1 processor, hosted on a dell XPS dual core at 2 GHZ with 2 GB ram)

I barely started on a project in lazarus about 2 weeks ago. The project involves indy as a 3rd party component and the rest of the about 60 files in 2 projects totaling around 190 KB (pas files only) were written during the past 2 weeks.
This is just the skeleton of the project, the size of the code will at least triple and the number of files will probably grow over 80.

the problems I experiance are:
- I have the code compiled and want to debug something which does not require code modification. I modify for example a config file and want to debug the effects. I hit run, but I have to wait until it rebuilds. this is annoying as I get to loose upto 2 minutes
 -I make a small modification and I want to just compile (or debug. or build), I again have to wait until everything is rebuilded.

you can see how frustrating this is. and for some reason I just cannot find a way to configure the ide/compiler to re-build/re-compile only when needed. hopefully, I'm just blind.

eventually, I'll be making a commandline build process since this project will be multiplatform, but for now I want my development to go faster. wasting almost 2 minutes with each compile/build is unacceptable. I get to compile/build at least 30 times a day which makes this waste 1 development hour per day making me look unefficient.

thanks :)
freelancer

ciuly

  • New Member
  • *
  • Posts: 47
  • Delphi/C# developer
    • Ciuly's Web Corner
RE: compiling/building takes over 1 minute
« Reply #1 on: November 04, 2007, 05:58:33 pm »
I played areound setting and set teh compiler to show everything during compile time.
so I get a *lot * (a ton) of searching for file .... not found and unitsearch.

I guess this might be one cause for the slow compile. what would be a correct path-setup?
freelancer

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
RE: compiling/building takes over 1 minute
« Reply #2 on: November 04, 2007, 07:25:27 pm »
1. what fpc version?
2. # of lines together? (usually displays on end of compilation)

You are most likely waiting for the linker if you use older FPC (2.0.4). FPC 2.2.0 added an internal linker to windows which is much faster. You can see if it's linking you wait on if the output is stopped on "linking".

If you do a small change, you should only get the changed stuff recompiled.

ciuly

  • New Member
  • *
  • Posts: 47
  • Delphi/C# developer
    • Ciuly's Web Corner
RE: compiling/building takes over 1 minute
« Reply #3 on: November 04, 2007, 08:31:35 pm »
1. 2.0.4
2. depends on modified unit(s). for example I modified the dpr only (20 lines) and it took around 83 seconds, just as long as when I modified another unit of 200 something lines (well, +/- 2-3 seconds)

I'm not waiting for the linker for sure. it's about 1 minute at elast until the linking message comes up. and if I click on something, everything goes white (meaning the compilation is not exactly torn apart from the UI)

>>If you do a small change, you should only get the changed stuff recompiled.
that would be fine, but really, recompiling only the changed stuff (one unit) takes over 80 seconds? (well, with linking too). something somewhere is wrong, and I first blame my configuration, though I don't exclude bugs.

right now for example, I didn't change anything. I hit quick compile and it took 85 seconds and it says 20 lines compiled (the active editor contained a unit with an empty type declaration totalling 20 lines. but then again, the dpr is 20 lines as well). normally, it should do almost nothing, right? jsut check the units, see that nothing is modified and basta. but still it takes 85 seconds to do the "quick" compilation. nasty.
freelancer

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
RE: compiling/building takes over 1 minute
« Reply #4 on: November 04, 2007, 10:14:33 pm »
Uncheck Project Options -> Miscellaneous -> Always build.

Check in the task manager what processes is running (LD?).

Try a fpc 2.2.0 base snapshot.

ciuly

  • New Member
  • *
  • Posts: 47
  • Delphi/C# developer
    • Ciuly's Web Corner
RE: compiling/building takes over 1 minute
« Reply #5 on: November 05, 2007, 12:12:04 pm »
no luck. exactly the same things happened in both quick compile (85 sec) and build (92 sec) (again, no modifications) I even restarted the ide after changing that option and verified that it was unchecked, to be sure.

the ld.exe was running at one moment during build (probably at link time)

the problem seems to be with ppc386.exe as it is using the cpu at over 80-90% very often at 99% during the whole compilation time.

can you confirm that this is not happening with a 2.2.0 snapshot? because I wouldn't want to use a not yet stable release in production mode unless it really improves things.
freelancer

windy

  • Full Member
  • ***
  • Posts: 186
RE: compiling/building takes over 1 minute
« Reply #6 on: November 05, 2007, 10:39:20 pm »
I recommend to use a snap shot upgrade, much improvements have been made :)

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
RE: compiling/building takes over 1 minute
« Reply #7 on: November 05, 2007, 11:31:17 pm »
Or wait one or two weeks for the 0.9.24 release.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
RE: compiling/building takes over 1 minute
« Reply #8 on: November 06, 2007, 05:32:49 am »
2.0.4 is real slow, 2.2.0 internal linker works more than 2 times faster than ld.
On PIV 3 GHz, 256 MB it only takes a minute to rebuild the IDE! But I'm not sure if it's automatically on, add -Xi to compiler option. Btw, 2.2.0 is a stable release.

ciuly

  • New Member
  • *
  • Posts: 47
  • Delphi/C# developer
    • Ciuly's Web Corner
compiling/building takes over 1 minute
« Reply #9 on: November 06, 2007, 08:57:28 am »
I think I'll try the snapshot. 1-2 weeks is too much for by nerves :D
I'll report back later in teh day with results
freelancer

 

TinyPortal © 2005-2018