Go Down

Topic: Arduino IDE faster than ever? (Read 747 times) previous topic - next topic

rtek1000

Apr 22, 2019, 07:01 am Last Edit: Apr 22, 2019, 08:01 pm by rtek1000
Hi,

'I was looking for a way to shorten the compile time of the IDE', and in the end, I was able to improve the performance of the computer by doing maintenance on the processor heatsink, which was not fully aligned, so the processor slowed down when it warmed up.

But I was thinking, while watching the compilation steps, that IDE accesses the temporary folder several times. And auxiliary folders, which if left in portable mode, seem to help.

I do not know the actual size that the temporary folder can occupy, but imagine if these steps can be performed in a RAMDRIVE.

On old computers, with Pentium III, I used RAMDRIVE for gaming, and the performance was pretty good.

I know we have SSDs today, but they still do not compare to RAMDRIVE.

Is it possible to add a setting in the preferences, to indicate a folder (RAMDRIVE) so that the IDE can use this location for compilation? What size would it take?



Source: https://www.raymond.cc/blog/12-ram-disk-software-benchmarked-for-fastest-read-and-write-speed/

(https://www.arduino.cc/en/Guide/PortableIDE)
Please avoid private messages, your question may be someone's answer in the future!

pert

I was looking for a way to slow down the build time of the IDE
Why do you want to slow it down?

Is it possible to add a setting in the preferences, to indicate a folder (RAMDRIVE) so that the IDE can use this location for compilation? What size would it take?
Although there is no setting for it in the Arduino IDE's GUI, you can set the build folder by editing the preferences file directly:
  • File > Preferences
  • Click the link at the line following File > Preferences > More preferences can be edited directly in the file. That will open the Arduino15 (or similar name depending on OS) folder.
  • Close all Arduino IDE windows.
  • Open preferences.txt in a text editor.
  • Add a line to preferences.txt: build.path={custom build path}, where {custom build path} is the path on your computer where you want the build files to be stored.
  • Save preferences.txt


You can also set the build.path preference using the Arduino IDE's CLI (command line interface:
Code: [Select]
arduino --pref build.path=c:\foo --save-prefs
More information about the IDE's CLI:
https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc



If you are using arduino-cli, it allows you to set the build folder location:
Code: [Select]
arduino-cli compile --build-path c:\foo --fqbn arduino:avr:uno c:\Arduino\MySketch
You might also be interested in its --build-cache-path option.



Note that a common cause of slow compilations is antivirus software that does on-access scanning. The Arduino IDE runs a ton of commands during the compilation, so if the antivirus needs to do a scan for every one, it slows it way down. The solution is to whitelist the appropriate files/folders/processes in your antivirus software settings.

rtek1000

Why do you want to slow it down?
Sorry, I was trying to say: "I was looking for a way to shorten the compile time of the IDE" (Make compilation faster).
Please avoid private messages, your question may be someone's answer in the future!

rtek1000

#3
Apr 22, 2019, 08:03 pm Last Edit: Apr 22, 2019, 08:03 pm by rtek1000
... you can set the build folder by editing the preferences file directly:
  • Add a line to preferences.txt: build.path={custom build path}, where {custom build path} is the path on your computer where you want the build files to be stored.

Nice
Please avoid private messages, your question may be someone's answer in the future!

rtek1000

I've tried editing the file, and it seems to improve. But the second time I press 'Verify', the IDE reports an error. Is it a bug?


First time ok:
Quote
Linking everything together...
"I:\\Arduino\\1- IDE\\arduino-1.8.9\\hardware\\tools\\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "Q:\\arduino_build/barGraph.ino.elf" "Q:\\arduino_build\\sketch\\barGraph.ino.cpp.o" "Q:\\arduino_build/core\\core.a" "-LQ:\\arduino_build" -lm
"I:\\Arduino\\1- IDE\\arduino-1.8.9\\hardware\\tools\\avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "Q:\\arduino_build/barGraph.ino.elf" "Q:\\arduino_build/barGraph.ino.eep"
"I:\\Arduino\\1- IDE\\arduino-1.8.9\\hardware\\tools\\avr/bin/avr-objcopy" -O ihex -R .eeprom "Q:\\arduino_build/barGraph.ino.elf" "Q:\\arduino_build/barGraph.ino.hex"
"I:\\Arduino\\1- IDE\\arduino-1.8.9\\hardware\\tools\\avr/bin/avr-size" -A "Q:\\arduino_build/barGraph.ino.elf"
Sketch uses 1086 bytes (3%) of program storage space. Maximum is 32256 bytes.
Global variables use 29 bytes (1%) of dynamic memory, leaving 2019 bytes for local variables. Maximum is 2048 bytes.
Second time error:
Quote
Linking everything together...
Rel: can't make C:\Users\user\AppData\Local\Temp\arduino_cache_475012\core\core_arduino_avr_uno_c94a07b2fc865919ed83bfeed74500ec.a relative to Q:\arduino_build
Error compiling for board Arduino/Genuino Uno.
Please avoid private messages, your question may be someone's answer in the future!

rtek1000

You might also be interested in its --build-cache-path option.
This part I could not get it to work, I tried 'build.cache' and 'build.cache.path', but it looks like the folder I indicated is not being used.

Note: 'Q:\' is a 100MB RAM Disk (created by 'ROG RAMDisk 2.02.06').
Please avoid private messages, your question may be someone's answer in the future!

pert

This part I could not get it to work, I tried 'build.cache' and 'build.cache.path', but it looks like the folder I indicated is not being used.
You misunderstood what I wrote. --build-cache-path is an option of arduino-cli compile. I don't know what the equivalent would be for the Arduino IDE.
https://github.com/arduino/arduino-cli

pert

the second time I press 'Verify', the IDE reports an error. Is it a bug?
@rtek1000's report of this on the GitHub issue tracker:
https://github.com/arduino/Arduino/issues/8812

Possibly related:
https://github.com/arduino/arduino-cli/issues/197#issuecomment-483504623

rtek1000

Please avoid private messages, your question may be someone's answer in the future!

rtek1000

You misunderstood what I wrote. --build-cache-path is an option of arduino-cli compile. I don't know what the equivalent would be for the Arduino IDE.
https://github.com/arduino/arduino-cli
Oh, ok. Thank you.
Please avoid private messages, your question may be someone's answer in the future!

rtek1000

I did another test: With a RAMDisk of 512MB,

I pasted the IDE (zip), and added the 'portable' folder.

When opening the IDE from the normal SATA hard drive, it takes about 7 seconds to go through the Splash  :(

Already using RAMDisk it only takes 3 seconds to close Splash  ;D

Unfortunately only one IDE already consumes almost all of this space, more than 500MB.

(with support for STM32 and ESP32 goes to around 2GB)
Please avoid private messages, your question may be someone's answer in the future!

Go Up