Files
releases/race.txt
T
Anders Eknert 52e587ab11 perf: Add ref.CopyNonGround (#7350)
Refs copied for the purpose of modification often don't need
_all_ parts deep-copied, but only those to be modified. It turns
out that in most cases in the context of eval, **no** parts of
the ref needs copying, as those refs are static. This PR adds
a simple new method to refs that allows smarter copying, saving
a million and a half allocations in the `regal lint` benchmark,
and hundreds to thousands of allocations in common policy
evaluation.

**Before**
```
1716967000 ns/op	3125089752 B/op	62201992 allocs/op
```
**After**
```
1679479541 ns/op	3086159368 B/op	60630066 allocs/op
```

Also added an unrelated benchmark of a trivial policy, as I've
been curious to track down costs of doing almost "nothing".

Signed-off-by: Anders Eknert <anders@styra.com>
2025-02-10 09:56:05 +01:00

0 lines
0 B
Plaintext