Try and create tmp files in /tmp if possible to take advanateg of tmpfs.
ie. memory, rather than write to sdcard.