mirror of https://github.com/k3s-io/k3s
![]() reflect.Call is fairly expensive, performing 8 allocations and having to set up a call stack. Using a fairly straightforward to generate switch statement, we can bypass that early in conversion (as long as the function takes responsibility for invocation). We may also be able to avoid an allocation for the conversion scope, but not positive yet. ``` benchmark old ns/op new ns/op delta BenchmarkPodConversion-8 14713 12173 -17.26% benchmark old allocs new allocs delta BenchmarkPodConversion-8 80 72 -10.00% benchmark old bytes new bytes delta BenchmarkPodConversion-8 9133 8712 -4.61% ``` |
||
---|---|---|
.. | ||
queryparams | ||
OWNERS | ||
cloner.go | ||
converter.go | ||
converter_test.go | ||
deep_copy_generated.go | ||
deep_copy_test.go | ||
deep_equal.go | ||
doc.go | ||
helper.go | ||
helper_test.go |