about summary refs log tree commit diff stats
path: root/cleave/cleave.cc
Commit message (Collapse)AuthorAgeFilesLines
* 3413Kartik K. Agaram2016-09-241-2/+5
|
* 3288 - cleaner heuristic for cleavingKartik K. Agaram2016-08-311-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the last couple of days I've been implicitly thinking in terms of how many compilation units I want to generate. Might as well make that explicit and drop the hacky ideas for approximating it. I tried more timing experiments like the ones in commit 3281. Conclusion: I can't have the best of both worlds: 1. Full compilation doesn't take too much longer than with a single compilation unit. 2. Incremental compilation is fast enough that there's negligible benefit from dropping optimization. We're still taking on a 10s hit in full build time. I care more about not degrading the full compilation too much, since that gets magnified so much on the Couch's puny server. So we'll just have to continue using CXXFLAGS=-g when we care to save a few seconds in incremental compilation time. A final mystery: the build time increases by 10s with the new heuristic even though the number of calls to the compiler (and therefore the fixed cost) is the same. Seems like separating certain functions into different units is causing the compiler issues. Dropping from 4 to 3 compilation units eliminated the issue. --- Appendix: Measurements before: full build 4 + test: 42s incremental compilation with -O3: varied from 30s for mu_0.cc to 5s for mu_3.cc longer times benefitted from dropping -O3 after: full build 1 + test: 39s full build 2 + test: 41s full build 3 + test: 43s full build 4 + test: 52s full build 5 + test: 53s full build 6 + test: 51s full build 10 (9) + test: 54s full build 20 (16) + test: 58s
* 3284Kartik K. Agaram2016-08-301-6/+6
|
* 3281 - faster incremental builds for layersKartik K. Agaram2016-08-291-0/+244
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.
^
6a1fdc95 ^
22b30692 ^
11fa4fe1 ^

5497090a ^
22b30692 ^
11fa4fe1 ^
22b30692 ^







11fa4fe1 ^

11fa4fe1 ^
255cc288 ^
















ad8e984f ^

255cc288 ^
ad8e984f ^
23fd54f1 ^
22b30692 ^

fc52705f ^
23fd54f1 ^



7c0d16a7 ^

fc52705f ^
7c0d16a7 ^
fc52705f ^

7c0d16a7 ^
22b30692 ^
e38c85a1 ^

23fd54f1 ^












255cc288 ^





ac0e9db5 ^
255cc288 ^
dfe0e4d4 ^
0487a30e ^
255cc288 ^


a70d593d ^
ba32c4f0 ^





a70d593d ^


77469816 ^

255cc288 ^
22b30692 ^
77469816 ^
de49fb42 ^
d061b7d8 ^
de49fb42 ^




2c7e84c2 ^
363be37f ^
dd0846dc ^


a39df92d ^
de49fb42 ^
22b30692 ^




de49fb42 ^
22b30692 ^
77469816 ^
e38c85a1 ^

255cc288 ^









5497090a ^
255cc288 ^






363be37f ^
255cc288 ^

0487a30e ^
255cc288 ^
363be37f ^
255cc288 ^
363be37f ^
dd0846dc ^
255cc288 ^
363be37f ^
31401373 ^
255cc288 ^
e38c85a1 ^

dd0846dc ^


363be37f ^
dd0846dc ^



255cc288 ^


5497090a ^
255cc288 ^

5497090a ^
255cc288 ^







260c3de2 ^




255cc288 ^
260c3de2 ^
255cc288 ^











363be37f ^
255cc288 ^

b2c86f7a ^
0487a30e ^

255cc288 ^






ac0e9db5 ^
255cc288 ^



0f125d5f ^
255cc288 ^


0f125d5f ^
255cc288 ^


827898fc ^
255cc288 ^

7feea75b ^
827898fc ^
260c3de2 ^
a1557e08 ^
827898fc ^
a1557e08 ^


827898fc ^
a1557e08 ^
260c3de2 ^
a1557e08 ^


77469816 ^

255cc288 ^





0487a30e ^
0f125d5f ^
255cc288 ^




ac0e9db5 ^
255cc288 ^
05d17773 ^

255cc288 ^





ac0e9db5 ^
7feea75b ^
047296d8 ^
260c3de2 ^
047296d8 ^


260c3de2 ^
047296d8 ^




255cc288 ^
ac0e9db5 ^
7feea75b ^
047296d8 ^
260c3de2 ^
a1557e08 ^
047296d8 ^
a1557e08 ^


047296d8 ^
a1557e08 ^
260c3de2 ^
047296d8 ^




255cc288 ^



260c3de2 ^
255cc288 ^









260c3de2 ^
255cc288 ^

5497090a ^



255cc288 ^







5497090a ^



255cc288 ^















260c3de2 ^
255cc288 ^











363be37f ^
255cc288 ^

b2c86f7a ^
0487a30e ^
255cc288 ^






4071055a ^
255cc288 ^
5feb36ff ^
ac0e9db5 ^
255cc288 ^
ac0e9db5 ^
5feb36ff ^


255cc288 ^

ac0e9db5 ^
4071055a ^


255cc288 ^

5feb36ff ^

255cc288 ^

d9cd13ad ^

5feb36ff ^
255cc288 ^
5feb36ff ^
ac0e9db5 ^
0487a30e ^

ac0e9db5 ^
5feb36ff ^
255cc288 ^




260c3de2 ^
255cc288 ^












260c3de2 ^
255cc288 ^









5877ef32 ^
255cc288 ^





260c3de2 ^
255cc288 ^













363be37f ^
255cc288 ^

b2c86f7a ^
0487a30e ^
255cc288 ^







5feb36ff ^
ac0e9db5 ^
5feb36ff ^

255cc288 ^







260c3de2 ^
255cc288 ^






5877ef32 ^
255cc288 ^

260c3de2 ^
255cc288 ^











b39ceb27 ^

22b30692 ^
255cc288 ^

23fd54f1 ^
255cc288 ^

1326a4ec ^
255cc288 ^
1326a4ec ^
255cc288 ^



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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552