internal/core/adt: place CallContext on the stack
It is a small struct, weighing as much as seven pointers.
None of the methods need a pointer receiver either,
as they only read from the receiver value.
The extra allocation per func call can really add up
when doing many thousands of calls.
│ old │ new │
│ B/op │ B/op vs base │
VetInventory 4.725Gi ± ∞ ¹ 4.703Gi ± ∞ ¹ -0.48% (p=1.000 n=1)
│ old │ new │
│ allocs/op │ allocs/op vs base │
VetInventory 51.05M ± ∞ ¹ 49.86M ± ∞ ¹ -2.34% (p=1.000 n=1)
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I2d7b696ad78be327f2cfa260091cb769969d8169
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1229426
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Matthew Sackman <matthew@cue.works>