Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cue: use append-like funcs inside Value.MarshalJSON
So that we can reuse buffers where possible rather than making new ones only to copy the data over to the final buffer. Note that this doesn't happen everywhere yet, as the underlying API we use to marshal literals is json.Marshal, which is not append-like. │ old │ new │ │ sec/op │ sec/op vs base │ LargeValueMarshalJSON-8 12.240m ± 1% 7.772m ± 1% -36.50% (p=0.002 n=6) │ old │ new │ │ B/op │ B/op vs base │ LargeValueMarshalJSON-8 23.508Mi ± 0% 7.158Mi ± 0% -69.55% (p=0.002 n=6) │ old │ new │ │ allocs/op │ allocs/op vs base │ LargeValueMarshalJSON-8 78.36k ± 0% 70.28k ± 0% -10.32% (p=0.002 n=6) Updates cue-lang#2470. Signed-off-by: Daniel Martí <[email protected]> Change-Id: Idd806ce52f9726ffd87d6bf71c2759131d2553a5 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1201808 Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Roger Peppe <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
- Loading branch information