We don't use the extensions feature, so having it in the code has a couple of downsides:
it causes the receiver of CodecDecodeSelf() to escape, so the Go compiler will always move it to the heap; in certain circumstances this creates a lot of garbage
it causes a little extra work to check if there are any handlers for every element.
Therefore I would like an option on codecgen to disable extensions and stop generating this line:
We don't use the extensions feature, so having it in the code has a couple of downsides:
CodecDecodeSelf()
to escape, so the Go compiler will always move it to the heap; in certain circumstances this creates a lot of garbageTherefore I would like an option on
codecgen
to disable extensions and stop generating this line:Happy to do a PR myself.