I have a laptop with Linux Slackware. When it's working on battery saving a file to hard drive takes around a second. When I'm writing code I waste a lot of time saving the files.
I have about 2 GB of free RAM, so I can use 1 GB as a temporary buffer. And work like this:
- Load the file into the RAM buffer.
- Work with the file and save it there.
- At the end of work the file is moved to the HDD.
The problem is that the file is a php script, used by Apache. So, I must somehow make the buffer transparent for it and make it use the RAM file when it's applying to the original file.