3 ms·
What's especially fun is using tmpfs as root on NixOS. That way your root partition gets cleared out on any reboot, so cleaning up your mess is never really mor
by tombert 2y ago
What's especially fun is using tmpfs as root on NixOS. That way your root partition gets cleared out on any reboot, so cleaning up your mess is never really more than a reboot away.
I've never thought about mounting a tmpfs folder for compiling stuff, but that's actually a pretty good idea.
- Aurornis 2y ago> I've never thought about mounting a tmpfs folder for compiling stuff, but that's actually a pretty good idea. Using tmpfs (or RAMDISK) for compiling and discovering that it’s not actually faster is a virtually rite of passage for every developer. :) If you do try it, at least benchmark it. You’ll probably discover that you spent more time setting it up and copying files around to volatile storage than you’d ever gain back via minuscule compile time speedups. Compiling is not IO bound and your files are already being cached in RAM by the OS after the first read.
- tombert 2y agoIt’s actually not really about speed in my particular case; I mostly just don’t want lots of tiny intermediate files being written and rewritten on my SSD all the time. I would sleep better if I knew that they wouldn’t have any negative effects on the lifetime of my drive. I have a tmpfs folder mounted for my downloads folder for my browser for similar reasons; not for speed but to reduce drive wear and automatic cleanup so that it doesn’t pile up for forever.
- JonChesterfield 2y agoIt's faster. I don't move the source code around though, the intermediate build directory cmake writes binaries into is under a tmpfs mount and the install dir is back on disk. Currently has 10gb in it with 30m of uptime. The gain would be less if I was more willing to trust ccache, or if the cmake dependency graph of the project was trustworthy - my default build deletes all the files from the last one.
- toast0 2y ago> If you do try it, at least benchmark it. You’ll probably discover that you spent more time setting it up and copying files around to volatile storage than you’d ever gain back via minuscule compile time speedups. Compiling is not IO bound and your files are already being cached in RAM by the OS after the first read. You shouldn't need to copy files to volatile storage, just storing the outputs there. Maybe only storing the intermediate outputs there. Some build processes just dump intermediate outputs all over the place, but a lot of them have a directory for those, and it shouldn't take much to make that directory be on tmpfs or similar.
- MrDrMcCoy 2y agoI don't do it for speed. I do it because I'm abusive enough to my storage even without that.