Go Down

Topic: RAM disk for compiling sketches (Read 497 times) previous topic - next topic

PaulVdB

Wouldn't it be much faster if the compiler could use a RAMdisk to do the stuff compilers do ?

If YES : how ???

1000 x thanks for every reply !    :)

ballscrewbob

The newer IDE's have had the agressive cache feature for a while now.
SO not sure what you are really trying to say unless you have some very old hardware.


It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

PaulVdB

#2
Jan 13, 2019, 01:16 pm Last Edit: Jan 13, 2019, 01:16 pm by PaulVdB
The newer IDE's have had the agressive cache feature for a while now.
SO not sure what you are really trying to say unless you have some very old hardware.
My hardware is not brandnew, but I guess that an AMD 8core with 32G of Ram is "new enough" ... :)
I see when the compiler is running, it uses to the C drive to put temporary files etc. My C drive is SSD, but a RAM disk is soooo muich faster than an SSD. Also the C drive is constantly in use by windows. If you're compiling a 50-line program, it's no use to use a ram disk to compile. But if we're talking about a sketch of a few thousand lines, it might save quite some time ...
So : how to direct the compiler to my RAM disk instead of to my C drive ???

Thanks !

ballscrewbob

A little beyond me but you could try the CLI version of the IDE

AFAIK its still in ALPHA but should allow you to direct to your ram disk.

There is also a thread for SLOW compile times that may also be worth looking at as there may be some further hints to increase speed there.

My hardware is less than yours but I dont really have any issues with speed even on larger compiles and I too use SSD as a primary drive with a SPLIT install.

It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

DrAzzy

#4
Jan 14, 2019, 04:03 am Last Edit: Jan 14, 2019, 04:03 am by DrAzzy
Looking at the preferences file, I don't see any entry to set the location of the build folders used while compiling. So there may not be a way to do this...

Usually compile times slow enough to care about are due to other problems, most often an antivirus program set to do realtime scanning scanning each file created during the compile process.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Coding Badly

Wouldn't it be much faster if the compiler could use a RAMdisk to do the stuff compilers do ?
Not with a modern operating system / file system.


westfw

There used to be a preference for build directory location...
I'll see if I can hunt it down...

PaulVdB


PaulVdB

Not with a modern operating system / file system.


What do you mean with "modern OS/filesystem" ?
Do "modern" OS/file systems read and write with the same speed on Ram disk and SSD ?

ANyhow : thanks for your reply !

Coding Badly

Do "modern" OS/file systems read and write with the same speed on Ram disk and SSD ?
Yes.  Write-behind cache is the key-phrase.  Using a RAMdisk just steals memory from the operating system.


PaulVdB

Yes.  Write-behind cache is the key-phrase.  Using a RAMdisk just steals memory from the operating system.


OK. but then : why is there a HUGE difference in "compiling-time" betwwen my PC (C: = SSD) and my laptop (C: = HD) ?
Shouldn't there be about the same difference between SD and RAM ?
Because I have 32 GB RAM installed, a RAMdisk of 10GB is always installed at boot. So "stealing" RAM isn't an issue. I use this RAMdisk for all (possible) .temp files and the like...(saves A LOT of time !)
But I begin to believe that the Arduino IDE just can't work with another disk than C: ...

Nevertheless : my question stays ... :) and thanks for your reply.

westfw

#11
Jan 17, 2019, 10:49 am Last Edit: Jan 17, 2019, 10:51 am by westfw
There used to be a preference for build directory location...
I'll see if I can hunt it down...
Code: [Select]
build.path=/tmp/ArduBuild/

See: https://github.com/arduino/Arduino/blob/master/arduino-core/src/processing/app/Sketch.java#L169

I remember this having "quirks", the last time I used it.  Something about needing the directory to exist beforehand, and then deleting it when you exited.   But the current comments imply that that's all fixed now (Cool.)

PS: I was also under the impression that RAMDisks were pretty useless these days; most OSes do a lot of disk caching automatically, if there is spare memory.  How do you even create a RAMDisk?

PaulVdB

Thanks for your search westf  !
As I see, it's not easy and maybe even not worth the hassle... Arduino does not like to work with RAMdisks...
As reply to your question how to get a ramdisk : there's several ways to do it. Just google "ramdisk" and many programs will show up.

westfw

I'd be interesting in any actual measurements you do...
Like I said, the preference seems to be mostly fixed.

Go Up