OLD | NEW |
1 # Tips for improving build speed on Linux | 1 # Tips for improving build speed on Linux |
2 | 2 |
3 This list is sorted such that the largest speedup is first; see | 3 This list is sorted such that the largest speedup is first; see |
4 [Linux build instructions](linux_build_instructions.md) for context and | 4 [Linux build instructions](linux_build_instructions.md) for context and |
5 [Faster Builds](common_build_tasks.md) for non-Linux-specific techniques. | 5 [Faster Builds](common_build_tasks.md) for non-Linux-specific techniques. |
6 | 6 |
7 [TOC] | 7 [TOC] |
8 | 8 |
9 ## General configuration | 9 ## General configuration |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 to get to the local physical disk directory where you keep those working | 87 to get to the local physical disk directory where you keep those working |
88 development directories, consider putting | 88 development directories, consider putting |
89 | 89 |
90 alias cd="cd -P" | 90 alias cd="cd -P" |
91 | 91 |
92 in your `.bashrc` so that `$PWD` or `cwd` always refers to a physical, not | 92 in your `.bashrc` so that `$PWD` or `cwd` always refers to a physical, not |
93 logical directory (and make sure `CCACHE_BASEDIR` also refers to a physical | 93 logical directory (and make sure `CCACHE_BASEDIR` also refers to a physical |
94 parent). | 94 parent). |
95 | 95 |
96 If you tune ccache correctly, a second working directory that uses a branch | 96 If you tune ccache correctly, a second working directory that uses a branch |
97 tracking trunk and is up-to-date with trunk and was gclient sync'ed at about the | 97 tracking trunk and is up to date with trunk and was gclient sync'ed at about the |
98 same time should build chrome in about 1/3 the time, and the cache misses as | 98 same time should build chrome in about 1/3 the time, and the cache misses as |
99 reported by `ccache -s` should barely increase. | 99 reported by `ccache -s` should barely increase. |
100 | 100 |
101 This is especially useful if you use `git-new-workdir` and keep multiple local | 101 This is especially useful if you use `git-new-workdir` and keep multiple local |
102 working directories going at once. | 102 working directories going at once. |
103 | 103 |
104 ## Using tmpfs | 104 ## Using tmpfs |
105 | 105 |
106 You can use tmpfs for the build output to reduce the amount of disk writes | 106 You can use tmpfs for the build output to reduce the amount of disk writes |
107 required. I.e. mount tmpfs to the output directory where the build output goes: | 107 required. I.e. mount tmpfs to the output directory where the build output goes: |
108 | 108 |
109 As root: | 109 As root: |
110 | 110 |
111 mount -t tmpfs -o size=20G,nr_inodes=40k,mode=1777 tmpfs /path/to/out | 111 mount -t tmpfs -o size=20G,nr_inodes=40k,mode=1777 tmpfs /path/to/out |
112 | 112 |
113 *** note | 113 *** note |
114 **Caveat:** You need to have enough RAM + swap to back the tmpfs. For a full | 114 **Caveat:** You need to have enough RAM + swap to back the tmpfs. For a full |
115 debug build, you will need about 20 GB. Less for just building the chrome target | 115 debug build, you will need about 20 GB. Less for just building the chrome target |
116 or for a release build. | 116 or for a release build. |
117 *** | 117 *** |
118 | 118 |
119 Quick and dirty benchmark numbers on a HP Z600 (Intel core i7, 16 cores | 119 Quick and dirty benchmark numbers on a HP Z600 (Intel core i7, 16 cores |
120 hyperthreaded, 12 GB RAM) | 120 hyperthreaded, 12 GB RAM) |
121 | 121 |
122 * With tmpfs: | 122 * With tmpfs: |
123 * 12m:20s | 123 * 12m:20s |
124 * Without tmpfs | 124 * Without tmpfs |
125 * 15m:40s | 125 * 15m:40s |
OLD | NEW |