I got a lot of time consuming compilation 64 bits apps but now I have speed up the compilation time about 1000x!!! I want to share with you the 2 tweaks:
This is only valid for high RAM (8 GB in my PC)
-Moving Temporary Files to Memory (RAM):
Before starting this process its a good idea to backup the fstab file:
sudo cp /etc/fstab /etc/fstab.bak
The next step is to edit fstab:
sudo gedit /etc/fstab
Add the following lines at the end of the file :
tmpfs /tmp tmpfs defaults,noatime,size=1G,mode=1777 0 0
tmpfs /var/tmp tmpfs defaults,noatime,mode=1777 0 0
tmpfs /var/log tmpfs defaults,noatime,mode=0755 0 0
tmpfs /var/log/apt tmpfs defaults,noatime 0 0
The swappiness value determines how much data is written to the virtual memory on the hard disk drive, which can slow your system down. Begin by opening a Terminal and entering:
The default swappiness value in Ubuntu is 60.
Next, open the /etc/sysctl.conf file in a text editor:
Scroll to the bottom and add the following parameter (and the associated note as a reminder):
Decrease swappiness value
With this done, save the file. Unusually for Linux, youll also need to restart the computer. Once booted up again, confirm the swappiness value has changed.
Now compilation time is instant for me!!!