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 ## Use goma | 9 ## Use goma |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 ## Linking | 60 ## Linking |
61 | 61 |
62 ### Dynamically link | 62 ### Dynamically link |
63 | 63 |
64 We normally statically link everything into one final executable, which produces | 64 We normally statically link everything into one final executable, which produces |
65 enormous (nearly 1gb in debug mode) files. If you dynamically link, you save a | 65 enormous (nearly 1gb in debug mode) files. If you dynamically link, you save a |
66 lot of time linking for a bit of time during startup, which is fine especially | 66 lot of time linking for a bit of time during startup, which is fine especially |
67 when you're in an edit/compile/test cycle. | 67 when you're in an edit/compile/test cycle. |
68 | 68 |
69 Run gyp with the `-Dcomponent=shared_library` flag to put it in this | 69 Add the flag `is_component_build=true` in your build args (to edit build args |
70 configuration. (Or set those flags via the `GYP_DEFINES` environment variable.) | 70 run `gn args out/foo` where `out/foo` is your build directory). |
71 | |
72 e.g. | |
73 | |
74 build/gyp_chromium -D component=shared_library | |
75 ninja -C out/Debug chrome | |
76 | 71 |
77 See the | 72 See the |
78 [component build page](http://www.chromium.org/developers/how-tos/component-buil
d) | 73 [component build page](http://www.chromium.org/developers/how-tos/component-buil
d) |
79 for more information. | 74 for more information. |
80 | 75 |
81 ### Linking using gold | 76 ### Linking using gold |
82 | 77 |
83 The experimental "gold" linker is much faster than the standard BFD linker. | 78 The experimental "gold" linker is much faster than the standard BFD linker. |
84 | 79 |
85 On some systems (including Debian experimental, Ubuntu Karmic and beyond), there | 80 On some systems (including Debian experimental, Ubuntu Karmic and beyond), there |
(...skipping 10 matching lines...) Expand all Loading... |
96 | 91 |
97 ## WebKit | 92 ## WebKit |
98 | 93 |
99 ### Build WebKit without debug symbols | 94 ### Build WebKit without debug symbols |
100 | 95 |
101 WebKit is about half our weight in terms of debug symbols. (Lots of templates!) | 96 WebKit is about half our weight in terms of debug symbols. (Lots of templates!) |
102 If you're working on UI bits where you don't care to trace into WebKit you can | 97 If you're working on UI bits where you don't care to trace into WebKit you can |
103 cut down the size and slowness of debug builds significantly by building WebKit | 98 cut down the size and slowness of debug builds significantly by building WebKit |
104 without debug symbols. | 99 without debug symbols. |
105 | 100 |
106 Set the gyp variable `remove_webcore_debug_symbols=1`, either via the | 101 Set the GN build arg `remove_webcore_debug_symbols=true` (to edit build args |
107 `GYP_DEFINES` environment variable, the `-D` flag to gyp, or by adding the | 102 run `gn args out/foo` where `out/foo` is your build directory). |
108 following to `~/.gyp/include.gypi`: | |
109 | |
110 ``` | |
111 { | |
112 'variables': { | |
113 'remove_webcore_debug_symbols': 1, | |
114 }, | |
115 } | |
116 ``` | |
117 | 103 |
118 ## Tune ccache for multiple working directories | 104 ## Tune ccache for multiple working directories |
119 | 105 |
120 (Ignore this if you use goma.) | 106 (Ignore this if you use goma.) |
121 | 107 |
122 Increase your ccache hit rate by setting `CCACHE_BASEDIR` to a parent directory | 108 Increase your ccache hit rate by setting `CCACHE_BASEDIR` to a parent directory |
123 that the working directories all have in common (e.g., | 109 that the working directories all have in common (e.g., |
124 `/home/yourusername/development`). Consider using | 110 `/home/yourusername/development`). Consider using |
125 `CCACHE_SLOPPINESS=include_file_mtime` (since if you are using multiple working | 111 `CCACHE_SLOPPINESS=include_file_mtime` (since if you are using multiple working |
126 directories, header times in svn sync'ed portions of your trees will be | 112 directories, header times in svn sync'ed portions of your trees will be |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 or for a release build. | 145 or for a release build. |
160 *** | 146 *** |
161 | 147 |
162 Quick and dirty benchmark numbers on a HP Z600 (Intel core i7, 16 cores | 148 Quick and dirty benchmark numbers on a HP Z600 (Intel core i7, 16 cores |
163 hyperthreaded, 12 GB RAM) | 149 hyperthreaded, 12 GB RAM) |
164 | 150 |
165 * With tmpfs: | 151 * With tmpfs: |
166 * 12m:20s | 152 * 12m:20s |
167 * Without tmpfs | 153 * Without tmpfs |
168 * 15m:40s | 154 * 15m:40s |
OLD | NEW |