Commit 4bb0a1f
committed
Avoid expensive computations in Stats.record calls
When `Stats.enabled` is false, `Stats.record` should be free, but before
this commit this wasn't the case: since the `n` passed to `record` was
by-value, it had to be evaluated, this is very expensive for calls like:
record("retained typed trees after typer", unit.tpdTree.treeSize)
Before this commit, we got after inlining:
val n = unit.tpdTree.treeSize
Now we get:
def n = unit.tpdTree.treeSize
it'd be even nicer if we didn't generate anything at all, but this
shouldn't have much impact on running time.1 parent 58b5203 commit 4bb0a1f
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
0 commit comments