Arduino IDE faster than ever?

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: RAM Disk Software: 11 Best Free Tools We Tested

(https://www.arduino.cc/en/Guide/PortableIDE)

rtek1000:
I was looking for a way to slow down the build time of the IDE

Why do you want to slow it down?

rtek1000:
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:

arduino --pref build.path=c:\foo --save-prefs

More information about the IDE's CLI:

If you are using arduino-cli, it allows you to set the build folder location:

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.

pert:
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).

pert:
... 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

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:

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:

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.

pert:
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').

rtek1000:
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.

1 Like

rtek1000:
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:

Possibly related:

pert:
@rtek1000's report of this on the GitHub issue tracker:
[RAM Disk] build.path preference to another partition, but gives error · Issue #8812 · arduino/Arduino · GitHub

Possibly related:
Build output path customization · Issue #197 · arduino/arduino-cli · GitHub

Ok, thank you!

pert:
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.
GitHub - arduino/arduino-cli: Arduino command line tool

Oh, ok. Thank you.

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 :frowning:

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)