-
Notifications
You must be signed in to change notification settings - Fork 446
avoid calling show_config_info and show_config_variable when ARDUINO_… #579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
avoid calling show_config_info and show_config_variable when ARDUINO_… #579
Conversation
i get your point, not sure if overloading the recipes for show_config_info() and show_config_variable() is the way to go though |
OK, simple check below helps us to understand this modification actually reduces the time. $ cat /proc/version
Linux version 4.4.0-43-Microsoft ([email protected]) (gcc version 5.4.0 (GCC) ) #1-Microsoft Wed Dec 31 14:42:53 PST 2014
$ cat /proc/meminfo | head -1
MemTotal: 8181796 kB
$ cat /proc/cpuinfo | grep "model name" | head -1
model name : Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
$ export ARDUINO_QUIET=1
$ pwd
/home/hiroaki/repository/Arduino-Makefile/examples/Blink
$ git branch
* master
undef_show_script_with_quiet
$ git rev-parse HEAD
b2d1ff23a2ff6d824aced575401e7b0deace672c
$ make # ignore first result because first make includes build time
$ time make
mkdir -p build-uno
real 0m17.049s
user 0m0.219s
sys 0m3.797s
$ git checkout undef_show_script_with_quiet
Switched to branch 'undef_show_script_with_quiet'
$ make # ignore first result because first make includes build time
$ time make
mkdir -p build-uno
real 0m12.987s
user 0m0.125s
sys 0m3.656s
$ git rev-parse HEAD
b39ce310a86159f836cd7e23821f75facbee8efe I also found configuration function such as PARSE_BOARD affects the performance. |
Hello. How can I proceed this discussion? |
Will the following not solve your problem? Line 91 in 22ca636
Could you please try the following on 'master' and post your result? time (ARDUINO_QUIET=1 make)
|
Yes, it doesn't solve the problem. |
Ah, my mistake. Sorry for that. My browser's font is set to large and it only displayed: In this case it must be a Win10 or a config problem. I'm using native Linux on hardware that's even slower than yours. I don't have this problem.
Maybe try benchmarking your build. I would suggest something like Just a shot in the dark: Is your PATH set correctly (efficiently)? It could be that your OS is scanning several directories with lots and lots of files, before it finds the right executable. On top of that, you are running in a virtual machine, so directory/file scanning could be very time consuming. |
As you mentioned, WSL certainly has large overhead. Because of it, this problem affect large impact with current WSL system. But I don't think this is windows-specific issue. $ cat /proc/version
Linux version 4.9.35-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #1014 SMP Fri Jun 30 14:47:43 BST 2017
$ cat /proc/meminfo | head -1
MemTotal: 945516 kB
$ cat /proc/cpuinfo | grep "model name" | head -1
model name : ARMv7 Processor rev 5 (v7l)
$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 8.0 (jessie)
Release: 8.0
Codename: jessie
$ git rev-parse HEAD
b2d1ff23a2ff6d824aced575401e7b0deace672c
$ time (export ARDUINO_QUIET=1; make) # ignore first result because first make includes build time
$ time (export ARDUINO_QUIET=1; make)
mkdir -p build-uno
( export ARDUINO_QUIET=1; make; ) 0.22s user 0.12s system 18% cpu 1.812 total
$ git checkout undef_show_script_with_quiet
Switched to branch 'undef_show_script_with_quiet'
raspberrypi:pi% git rev-parse HEAD
b39ce310a86159f836cd7e23821f75facbee8efe
$ time (export ARDUINO_QUIET=1; make) # ignore first result because first make includes build time
$ time (export ARDUINO_QUIET=1; make)
mkdir -p build-uno
( export ARDUINO_QUIET=1; make; ) 0.15s user 0.09s system 18% cpu 1.325 total As you can see, my pull request improves the performance 0.5 sec. |
For sure something like PARSE_BOARD will take time, as we're checking for the existence, reading and parsing the board file. I guess that on a raspberry-pi, the disk access is also not the fastest, which could explain the 0.5 seconds. The question now is how it scales. i.e. Does the time saved increase, if the total build gets say 10 times larger. @ALL: Is there someone that can point us to a 'large' public build, using Arduino-Makefile? Now that you're on Debian (Raspbian), could you please install daemontools ( |
…QUIET is defined
When slow machine or environments such as WSL is used, calling output script itself causes heavy overhead.
This pull request reduces the overhead when ARDUINO_QUIET is set.