Closed cstockton closed 5 years ago
Would you like any additional work done for this pull req @davecheney ?
@davecheney I'm glad to see performance improvements get in, was there any improvements I could have made to the patch that could have allowed me to maintain authorship?
I was trying to follow the commits above to see if I made any mistakes, from the diff it appears you didn't want to Grow a buffer? This has a pretty big impact on performance of the patch in the common %+v scenario:
BenchmarkStackFormatting/%+v-stack-10-24 15221 21093 +38.58%
BenchmarkStackFormatting/%+v-stack-30-24 28797 43941 +52.59%
BenchmarkStackFormatting/%+v-stack-60-24 28479 42015 +47.53%
BenchmarkStackFormatting/%+v-stack-10-24 6 19 +216.67%
BenchmarkStackFormatting/%+v-stack-30-24 3 33 +1000.00%
BenchmarkStackFormatting/%+v-stack-60-24 3 33 +1000.00%
That said I would have been happy to remove it to maintain authorship for the work I put into fixing this and patiently waiting for it to be reviewed and merged, just something to consider for your future contributors. Thanks.
Please send a diff with the grow change. When I merged your change I found that it didn’t affect the benchmarks so I removed it. Please feel free to send a PR with it added back.
Sorry about obscuring the authorship, merge conflict and reverting other changes to this file were the cause.
On 28 Jan 2019, at 03:53, Chris Stockton notifications@github.com wrote:
@davecheney I'm glad to see performance improvements get in, was there any improvements I could have made to the patch that could have allowed me to maintain authorship?
I was trying to follow the commits above to see if I made any mistakes, from the diff it appears you didn't want to Grow a buffer? This has a pretty big impact on performance of the patch in the common %+v scenario:
BenchmarkStackFormatting/%+v-stack-10-24 15221 21093 +38.58% BenchmarkStackFormatting/%+v-stack-30-24 28797 43941 +52.59% BenchmarkStackFormatting/%+v-stack-60-24 28479 42015 +47.53%
BenchmarkStackFormatting/%+v-stack-10-24 6 19 +216.67% BenchmarkStackFormatting/%+v-stack-30-24 3 33 +1000.00% BenchmarkStackFormatting/%+v-stack-60-24 3 33 +1000.00% That said I would have been happy to remove it to maintain authorship for the work I put into fixing this and patiently waiting for it to be reviewed and merged, just something to consider for your future contributors. Thanks.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
This implements proposal in #149 by adding a format method to
Frame
that accepts anio.Writer
, allowingstack
andStackTrace
to grow abytes.Buffer
ahead of time. The benefits are illustrated in the benchmark comparison below, in summary allocations are reduced by 90-97% resulting in a 40-55% performance boost.This comes at a slight cost in bytes used, which is around 5% higher on average with a single case reaching 36% (small stack, %s) which is probably not worth special casing. This trade off can be affected by adjusting stackMinLen with a more generous multiplier, lowering allocations at the expense of unused buffer.