The PR: https://github.com/golang/go/pull/47804
On Wednesday, August 18, 2021 at 11:35:05 PM UTC-4 tapi...@gmail.com wrote: > More specifically, the last parameter (needzero) of mallocgc is not passed > down to c.nextFree, which causes the memclrNoHeapPointers function is > called twice in makeslicecopy if the slice size <= 32768. > > On Wednesday, August 18, 2021 at 11:06:53 PM UTC-4 tapi...@gmail.com > wrote: > >> Spent some time on investigating this problem. It is confirmed that, when >> N == 16384, the memclrNoHeapPointers function is called twice in the >> Insert2 function. That means the "make+copy` optimization introduced in Go >> 1.15 will perform worse than the normal route under such situation. >> >> On Wednesday, July 28, 2021 at 10:43:38 AM UTC-4 tapi...@gmail.com wrote: >> >>> >>> The benchmark code: https://play.golang.org/p/IqVnVa5x9qp >>> >>> When N == 16384, the benchmark result: >>> >>> Benchmark_Insert-4 134622 8032 ns/op 32768 >>> B/op 1 allocs/op >>> Benchmark_Insert2-4 132049 8201 ns/op 32768 >>> B/op 1 allocs/op >>> >>> When N == 16385, the benchmark result: >>> >>> Benchmark_Insert-4 118677 9374 ns/op 40960 >>> B/op 1 allocs/op >>> Benchmark_Insert2-4 136845 7744 ns/op 40960 >>> B/op 1 allocs/op >>> >> -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/cebecc7f-3828-474b-8dc4-cad564ca4031n%40googlegroups.com.