RAM drive for compiling - is there such a thing?

后端 未结 18 2109
既然无缘
既然无缘 2020-12-02 08:16

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 in

18条回答
  •  误落风尘
    2020-12-02 08:18

    My final solution to the problem is vmtouch: https://hoytech.com/vmtouch/ This tool locks the current folder into (ram) cache and vmtouch daemonizes into background.

    sudo vmtouch -d -L ./
    

    Put this in shell rc for fast access:

    alias cacheThis = 'sudo vmtouch -d -L ./'
    

    I searched for a ready made script for quite a while, because I didn't want to waste a lot of time on writing my own ramdisk-rsync-script. I'm sure I would have missed some edge cases, which would be quite unpleasant if important code was involved. And I never liked the polling approach.

    Vmtouch seems like the perfect solution. In addition it doesn't waste memory like a fixed size ramdisk does. I didn't do a benchmark, because 90% of my 1Gig source+build folder were already cached, but at least it feels faster ;)

提交回复
热议问题