Author Topic: speed up build time with distcc  (Read 1078 times)

andy_5995

  • Moderator
  • Ornithopter
  • ********
  • Posts: 478
  • Debian Linux user
    • View Profile
    • Andy Alt's home page
speed up build time with distcc
« on: 6 April 2016, 21:04:59 »
Last week I experimented building MG using 'distcc' to speed up build time.
Normally I build on a quad-core 3.2G machine. I distributed (using distcc) the build to a second computer 2 cores @2.4 g. The build went from ~8 minutes to ~5 minutes

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: speed up build time with distcc
« Reply #1 on: 8 April 2016, 09:30:13 »
8 Minutes ???? Thats really a lot.
How do you build typically ? Do you use the script build-mg.sh in mk/linux ?
This sets the number of cores correctly and by this the build should not take so long :-/

If you run cmake manually followed by a make call, you should add the -j option to the make call, setting the number of cores which will be used.
So with 4 cores you do:
make -j4

If you have an Intel CPU with hyperthreading, you can try to run with -j8, but I don't know how much faster it will be.
« Last Edit: 8 April 2016, 09:43:35 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

filux

  • MegaGlest Team
  • Draco Rider
  • ********
  • Posts: 310
  • was OpenSuse x64, is Debian testing x64
    • View Profile
Re: speed up build time with distcc
« Reply #2 on: 8 April 2016, 16:22:20 »
well 4 cores + "gcc5+" = 8 minutes sounds ok for me,
take a look for some travis' results: https://travis-ci.org/MegaGlest/megaglest-source

andy_5995

  • Moderator
  • Ornithopter
  • ********
  • Posts: 478
  • Debian Linux user
    • View Profile
    • Andy Alt's home page
Re: speed up build time with distcc
« Reply #3 on: 8 April 2016, 16:39:59 »
Seems like gcc5 isn't on Debian stable yet.

version info:
gcc (Debian 4.9.2-10) 4.9.2

Yes, I'm using build-mg.sh from mk/linux, and it's using all 4 cores.


filux

  • MegaGlest Team
  • Draco Rider
  • ********
  • Posts: 310
  • was OpenSuse x64, is Debian testing x64
    • View Profile
Re: speed up build time with distcc
« Reply #4 on: 8 April 2016, 17:06:17 »
I didn't have version 4.9 for long but it was somehow like this: ~4.8 ok -> ... ~4.9 a bit slower  :| ... -> ~5.0 even slower again ;D

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: speed up build time with distcc
« Reply #5 on: 8 April 2016, 21:44:06 »
I still have gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4
AMD Phenom(tm) II X4 965 Processor 3.4 Ghz + a normal harddisk ( no SSD )

For me it takes 3:20 to compile.

Dow you have intel mobile versions or why are they running so slow ?
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

andy_5995

  • Moderator
  • Ornithopter
  • ********
  • Posts: 478
  • Debian Linux user
    • View Profile
    • Andy Alt's home page
Re: speed up build time with distcc
« Reply #6 on: 10 April 2016, 04:15:41 »
No, not Intel mobile versions.

# hdparm -t /dev/sda

/dev/sda:
 Timing buffered disk reads: 366 MB in  3.01 seconds = 121.57 MB/sec

I still have gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4
AMD Phenom(tm) II X4 965 Processor 3.4 Ghz + a normal harddisk ( no SSD )

For me it takes 3:20 to compile.

Dow you have intel mobile versions or why are they running so slow ?


 

anything