An answer (see below) to one of the questions right here on Stack Overflow gave me an idea for a great little piece of software that could be invaluable to coders everywhere.
I'm imagining RAM drive software, but with one crucial difference - it would mirror a real folder on my hard drive. More specifically - the folder which contains the project I'm currently working on. This way any builds would be nearly instantaneous (or at least a couple orders of magnitude faster). The RAM drive would synchronize its contents with the hard disk drive in background using only idle resources.
A quick Google search revealed nothing, but perhaps I just don't know how to Google. Perhaps someone knows of such a software? Preferably free, but reasonable fees might be OK too.
Added: Some solutions have been suggested which I discarded in the very beginning. They would be (in no particular order):
Added 2: An idea that came up - use a normal RAM drive plus a background folder synchronizer (but I do mean background). Is there any such thing?
Added 3: Interesting. I just tried out a simple RAM drive at work. The rebuild time drops from ~14 secs to ~7 secs (not bad), but incremental build is still at ~5 secs - just like on the HDD. Any ideas why? It uses aspnet_compiler
and aspnet_merge
. Perhaps they do something with other temp files elsewhere?
Added 4: Oh, nice new set of answers! :) OK, I've got a bit more info for all you naysayers. :)
One of the main reasons for this idea is not the above-mentioned software (14 secs build time), but another one that I didn't have access at the time. This other application has a 100 MB code base, and its full build takes about 5 minutes. Ah yes, it's in Delphi 5, so the compiler isn't too advanced. :) Putting the source on a RAM drive resulted in a BIG difference. I got it below a minute, I think. I haven't measured. So for all those who say that the OS can cache stuff better - I'd beg to differ.
Related Question:
RAM disk for speed up IDE
Note on first link: The question to which it links has been deleted because it was a duplicate. It asked:
What do you do while your code’s compiling?
And the answer by Dmitri Nesteruk to which I linked was:
I compile almost instantly. Partly due to my projects being small, partly due to the use of RAM disks.
Because RAM is a volatile storage device, most kinds of RAM on computers lost all data when it lost power. There do exist some software that can create a RAM disk for you to storage data. However, it is not recommended to store any valuable information on it just in case a power loss.
A good time to use a RAM disk is to load an image on a disk or RAM that does not touch the actual hard drive. This would allow you to install a new OS or restore or "fix" issues with your current OS.
Also called a RAM drive, a RAM disk is a virtual storage drive that you can create in Windows with 3rd-party software. Basically, you're telling your PC to reserve a portion of your RAM (eg, your DDR4 memory) as storage space so you can read/write to it like you would an HDD or SSD.
In Linux (you never mentioned which OS you're on, so this could be relevant) you can create block devices from RAM and mount them like any other block device (that is, a HDD).
You can then create scripts that copy to and from that drive on start-up / shutdown, as well as periodically.
For example, you could set it up so you had ~/code
and ~/code-real
. Your RAM block gets mounted at ~/code
on startup, and then everything from ~/code-real
(which is on your standard hard drive) gets copied over. On shutdown everything would be copied (rsync'd would be faster) back from ~/code
to ~/code-real
. You would also probably want that script to run periodically, so you didn't lose much work in the event of a power failure, etc.
I don't do this anymore (I used it for Opera when the 9.5 beta was slow, no need anymore).
Here is how to create a RAM disk in Linux.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With