openFrameworks icon indicating copy to clipboard operation
openFrameworks copied to clipboard

The speed of the compilation is too slow in MSYS2

Open vhyijk opened this issue 2 years ago • 7 comments

It took me half an hour to compile OF by using MSYS2 MinGW. I found most of the time was wasted by executing bash scripts instead of gcc/g++ itself spent. Could you please enhance the bash scripts to increase the speed?

vhyijk avatar May 17 '22 04:05 vhyijk

That does seem slow. Could you share the exact commands ( and order ) you used?

I will try and reproduce here. Curious if its easy to try the Visual Studio release how long it takes to compile examples/templates/emptyExample/

ofTheo avatar May 17 '22 15:05 ofTheo

cc @oxillo

ofTheo avatar May 17 '22 15:05 ofTheo

I have just modified JOBS at the 10th line of scripts\msys2\compileOF.sh:

#!/usr/bin/env bash

export LC_ALL=C

pushd `dirname $0` > /dev/null
SCRIPTPATH=`pwd`
popd > /dev/null

BUILD="install"
JOBS=16

but it didn't take any effects compileOF.sh

That does seem slow. Could you share the exact commands ( and order ) you used?

I will try and reproduce here. Curious if its easy to try the Visual Studio release how long it takes to compile examples/templates/emptyExample/

vhyijk avatar May 23 '22 12:05 vhyijk

Some hints / comments

  • Compile_OF.sh will build both the Debug and Release libs. So, it takes twice the time...
  • What are the specs of your machine? On a old computer, half an hour wouldn't surprise me so much. On my 7 years old laptop (4cores, 16G), it took me almost 25min to compile the 'master' branch with MINGW64 with default options (JOBS=1) and 15min with -j6 (JOBS=6)
  • The compilation process is heavy on file access (read/write). Your antivirus may want to check every access....
  • How do you observe/measure this is the bash script that is slowing down the compilation process ?

oxillo avatar May 31 '22 15:05 oxillo

Some hints / comments

  • Compile_OF.sh will build both the Debug and Release libs. So, it takes twice the time...
  • What are the specs of your machine? On a old computer, half an hour wouldn't surprise me so much. On my 7 years old laptop (4cores, 16G), it took me almost 25min to compile the 'master' branch with MINGW64 with default options (JOBS=1) and 15min with -j6 (JOBS=6)
  • The compilation process is heavy on file access (read/write). Your antivirus may want to check every access....
  • How do you ‎观察‎/measure this is the bash script that is slowing down the compilation process ?

I used my HDD to compile it, too, not SSD. Before compiling, I closed all my antiviruses. During compiling, I just opened Windows Task Manager and saw the waveform of the disk I/O status chart. My hard drive only worked every 20 seconds (Can be sure that there isn't anything wrong with my hard disk and my CPU is i5-11300H, very quick).

vhyijk avatar Jun 05 '22 14:06 vhyijk

https://stackoverflow.com/questions/929495/why-is-mingw-very-slow https://stackoverflow.com/a/66716937/9216273

dimitre avatar Oct 02 '22 02:10 dimitre

@3119369616 are you still using msys2 / openFrameworks?

dimitre avatar Dec 28 '23 02:12 dimitre