about summary refs log tree commit diff stats
path: root/static_dispatch.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-08-29 21:42:41 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-08-29 21:47:13 -0700
commita800400c360c302a06c4127a34023b92244bcbf6 (patch)
tree8bbd071e3f365caec6dcd2e641d2e7667a77ee62 /static_dispatch.mu
parent45912cf8c7ffa429eab1dfb66b8851752ae7ff27 (diff)
downloadmu-a800400c360c302a06c4127a34023b92244bcbf6.tar.gz
3281 - faster incremental builds for layers
Before:

  layers -> tangle -> g++

  All changes to (C++) layers triggered recompilation of everything,
  taking 35s on my laptop, and over 4 minutes on a puny server with just
  512MB of RAM.

After:

  layers -> tangle -> cleave -> g++

  Now a tiny edit takes just 5s to recompile on my laptop.

My initial approach was to turn each function into a separate
compilation unit under the .build/ directory. That blew up the time for
a full/initial compilation to almost 6 minutes on my laptop. Trial and
error showed 4 compilation units to be close to the sweet spot. Full
compilation is still slightly slower (43s) but not by much.

I could speed things up further by building multiple of the compilation
units in parallel (the recursive invocation in 'makefile'). But that
would put more pressure on a puny server, so I'm going to avoid getting
too aggressive.

--- Other considerations

I spent some time manually testing the dependency structure to the
makefile, making sure that files aren't unnecessarily written to disk,
modifying their timestamp and triggering dependent work; that changes to
layers don't unnecessarily modify the common headers or list of globals;
that changes to the cleave/ tool itself rebuild the entire project; that
the old auto-generated '_list' files plug in at the right stage in the
pipeline; that changes to common headers trigger recompilation of
everything; etc. Too bad it's not easy to write some tests for all this.

I spent some time trying to make sure the makefile was not too opaque to
a newcomer. The targets mostly flow from top to bottom. There's a little
diagram at the top that is hopefully illuminating. When I had 700
compilation units for 700 functions I stopped printing each one of those
compilation commands, but when I backed off to just 4 compilation units
I decided to err on the side of making the build steps easy to see.
Diffstat (limited to 'static_dispatch.mu')
0 files changed, 0 insertions, 0 deletions
='#n166'>166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252
ecs/ranger/commit/README?h=v1.9.0b6&id=36e4e71ee5643fc0b2c501956086434389ec5384'>36e4e71e ^
20ab9343 ^

20ab9343 ^





4ea0f69a ^

240394a4 ^
7dc8fef8 ^
36e4e71e ^

4a383291 ^
78a7d762 ^
e952d6cb ^
78a7d762 ^
e952d6cb ^
4ea0f69a ^

7838675f ^

07069888 ^

07069888 ^
7838675f ^

1891697f ^
755e7df1 ^
a3d5f44b ^
7838675f ^
7dc8fef8 ^
500cf259 ^


7dc8fef8 ^



240394a4 ^



240394a4 ^
7dc8fef8 ^
240394a4 ^




7dc8fef8 ^
240394a4 ^



e5fb3d74 ^
240394a4 ^

240394a4 ^
7dc8fef8 ^



7b33b517 ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96