1
- # Incremental Compilation in detail
1
+ # Incremental compilation in detail
2
2
3
3
<!-- toc -->
4
4
@@ -66,7 +66,7 @@ because it reads the up-to-date version of `Hir(bar)`. Also, we re-run
66
66
` type_check_item(bar) ` because result of ` type_of(bar) ` might have changed.
67
67
68
68
69
- ## The Problem With The Basic Algorithm: False Positives
69
+ ## The problem with the basic algorithm: false positives
70
70
71
71
If you read the previous paragraph carefully you'll notice that it says that
72
72
` type_of(bar) ` * might* have changed because one of its inputs has changed.
@@ -93,7 +93,7 @@ of examples like this and small changes to the input often potentially affect
93
93
very large parts of the output binaries. As a consequence, we had to make the
94
94
change detection system smarter and more accurate.
95
95
96
- ## Improving Accuracy: The red-green Algorithm
96
+ ## Improving accuracy: the red-green algorithm
97
97
98
98
The "false positives" problem can be solved by interleaving change detection
99
99
and query re-evaluation. Instead of walking the graph all the way to the
@@ -191,7 +191,7 @@ then itself involve recursively invoking more queries, which can mean we come ba
191
191
to the ` try_mark_green() ` algorithm for the dependencies recursively.
192
192
193
193
194
- ## The Real World: How Persistence Makes Everything Complicated
194
+ ## The real world: how persistence makes everything complicated
195
195
196
196
The sections above described the underlying algorithm for incremental
197
197
compilation but because the compiler process exits after being finished and
@@ -258,7 +258,7 @@ the `LocalId`s within it are still the same.
258
258
259
259
260
260
261
- ### Checking Query Results For Changes: HashStable And Fingerprints
261
+ ### Checking query results for changes: ` HashStable ` and ` Fingerprint ` s
262
262
263
263
In order to do red-green-marking we often need to check if the result of a
264
264
query has changed compared to the result it had during the previous
@@ -306,7 +306,7 @@ This approach works rather well but it's not without flaws:
306
306
their stable equivalents while doing the hashing.
307
307
308
308
309
- ### A Tale Of Two DepGraphs: The Old And The New
309
+ ### A tale of two ` DepGraph ` s: the old and the new
310
310
311
311
The initial description of dependency tracking glosses over a few details
312
312
that quickly become a head scratcher when actually trying to implement things.
@@ -344,7 +344,7 @@ new graph is serialized out to disk, alongside the query result cache, and can
344
344
act as the previous dep-graph in a subsequent compilation session.
345
345
346
346
347
- ### Didn't You Forget Something ?: Cache Promotion
347
+ ### Didn't you forget something ?: cache promotion
348
348
349
349
The system described so far has a somewhat subtle property: If all inputs of a
350
350
dep-node are green then the dep-node itself can be marked as green without
@@ -374,7 +374,7 @@ the result cache doesn't unnecessarily shrink again.
374
374
375
375
376
376
377
- # Incremental Compilation and the Compiler Backend
377
+ # Incremental compilation and the compiler backend
378
378
379
379
The compiler backend, the part involving LLVM, is using the query system but
380
380
it is not implemented in terms of queries itself. As a consequence it does not
@@ -406,7 +406,7 @@ would save.
406
406
407
407
408
408
409
- ## Query Modifiers
409
+ ## Query modifiers
410
410
411
411
The query system allows for applying [ modifiers] [ mod ] to queries. These
412
412
modifiers affect certain aspects of how the system treats the query with
@@ -472,7 +472,7 @@ respect to incremental compilation:
472
472
[ mod ] : ../query.html#adding-a-new-kind-of-query
473
473
474
474
475
- ## The Projection Query Pattern
475
+ ## The projection query pattern
476
476
477
477
It's interesting to note that ` eval_always ` and ` no_hash ` can be used together
478
478
in the so-called "projection query" pattern. It is often the case that there is
@@ -516,7 +516,7 @@ because we have the projections to take care of keeping things green as much
516
516
as possible.
517
517
518
518
519
- # Shortcomings of the Current System
519
+ # Shortcomings of the current system
520
520
521
521
There are many things that still can be improved.
522
522
0 commit comments