It takes a lot of time to test my current project. Now that you have more than one GB of free memory, why not let it play? TMPFS can speed up the execution of tests by keeping the file system in large memory.
But the advantage is also disadvantage, TMPFS only save the result in memory, so you have to write your own script to write the results back to disk for retention. And these scripts must be well written and executed, or they will lose some or all of their work.
A common approach is to work directly in the Tmpfs folder and then back up the work to a folder on disk. When your machine starts, you recover the Tmpfs folder from that backup folder. Synchronize TMPFS folders and disk folders with Cron after startup.
I found this setting to be a bit more complicated and error prone. At the start, or for Crom, I never really believed. Now I'm using a much simpler setup without cron at all.
Running a single test on my machine, using the IDE and publishing it on a Web server, is usually a reasonable performance, and it takes a lot of time to run all the tests.
I found the best place to set up a workspace on disk and synchronize with TMPFS running all tests in the/dev/shmand directory. This is more or less a change in my setup and eliminates the possibility of loose work, just because I'm too junk in the right settings.
The result of performance improvement is reasonable:
$ nosetests && run_tests.py ......................................................................................................................... ......................................................................................................................... ...----------------------------------------------------------------------Ran 248 tests in 107.070s OK ......................................................................................................................... ......................................................................................................................... ...----------------------------------------------------------------------Ran 248 tests in 19.423s OK
Now it's 5 times times faster than the original.
Using Python to set up is simple:
#!/bin/bash-e work=src/pylog=$ (pwd)/test.logtarget=$ (Hg root) shadow=/dev/shm/shadow/$TARGET date > $LOGmkdir-P $ SHADOW CD $SHADOWrsync--update--delete--exclude= ". *"--exclude=env--archive $TARGET. if [!-D ENV]then virtualenv envfi. Env/bin/activate CD $WORKpython setup.py develop >> $LOGnosetests $* | Tee-a $LOGexit ${pipestatus[0]}
I just need to repeat the synchronization to the/DEV/SHM directory, set up the test environment (VIRTUALENV and Python setup. PY) and run Test (nosetests).
A single test can still be run from the command line in the Tmpfs folder. You can also kick this away from your IDE, but you will lose your ability to run and debug your tests. As I said before, I don't need this right now.
I wish I could use this workaround for TMPFS to help you build a faster development environment without having to suffer from all the scripting headaches.