Ok, my iMac is late 2012 and only has 8GB of RAM. I decided to see if it would be possible to speed up my development cycle, especially for running unit tests and the like but just as much for an improved build time as well.
After much fiddling in the dark and reading some great pages, I eventually came up with the following solution that works for me but bear this in mind:
I have considered writing a small bash script to run `rsync` from a custom menu option (and thus a shortcut key binding) or look into using the Apple Automator to transfer any changed files across to the hard drive.
Once that is done, the next thing I do is check out my project (as I don't leave any changes uncommitted overnight just in case!) as a "new" one from source control into the RAM disk, that will make indexing a lot faster, and everything in general.
And then do a clean, rebuild and run. For me at least the change in build times and overall feelings of fuzzy warmness have been well worth it.
All the best.
After much fiddling in the dark and reading some great pages, I eventually came up with the following solution that works for me but bear this in mind:
Danger Will Robinson
RAM is volatile so everything you do is gone forever when you unmount it or shutdown so don't forget to copy your changes elsewhere. If you have Git integrated properly then get into the habit of committing frequently.
I have considered writing a small bash script to run `rsync` from a custom menu option (and thus a shortcut key binding) or look into using the Apple Automator to transfer any changed files across to the hard drive.
Whatever... you have been warned!
Step one: Create the RAM disk, I do it like this:
diskutil erasevolume HFS+ "RAMBO" `hdiutil attach -nomount ram://4194304`
Once that is done, the next thing I do is check out my project (as I don't leave any changes uncommitted overnight just in case!) as a "new" one from source control into the RAM disk, that will make indexing a lot faster, and everything in general.
Step Two: Gradle configuration
To tell gradle where to shove it (!) during a build, you need to add this to your project build.gradle file:allprojects { buildDir = "/Volumes/RAMBO/gradle-build/${rootProject.name}/${project.name}" repositories { jcenter() } }
And then do a clean, rebuild and run. For me at least the change in build times and overall feelings of fuzzy warmness have been well worth it.
All the best.
Comments
Post a Comment