1. 18:40 20th Oct 2011

    notes: 10

    tags: tip

    Speeding up Xcode using Ramdisk

    This is my 1 cent tip for speeding up building projects using Ramdisk.

    Steps

    1. Add more RAM modules to your MacBook (up to 8GB)
    2. Make a temporary ramdisk(1GB in size) using the following command:

    diskutil erasevolume HFS+ “ramdisk” `hdiutil attach -nomount ram://2097152`

    3. Now, the ramdisk is setup in /Volumes/ramdisk. Check it with ‘mount’ command.

    /dev/disk1 on /Volumes/ramdisk (hfs, local, nodev, nosuid, noowners, mounted by USER)

    4. Change the build path in Xcode: File -> Project Settings. Set ‘/Volumes/ramdisk’.

    5. All done.

    Benchmark Test: You can compare the speed of both ramdisk and HDD with a write test.

    dd if=/dev/zero of=/tmp/xxx bs=8k count=100000 (this took 1.8secs in Macbook 2.26GHz)

    dd if=/dev/zero of=/Volumes/ramdisk/xxx bs=8k count=100000 (this took 18secs in Macbook 2.26GHz)

    Notice: Unmount the ramdisk.

    hdiutil detach /dev/disk1

     
    1. oikonote10 posted this