1
0
mirror of https://github.com/DataDog/go-profiler-notes.git synced 2025-07-12 23:50:13 +02:00
Files
go-profiler-notes/examples/callers-func-length
Felix Geisendörfer f8f6e88e3a callers-func-length
2021-04-03 12:47:19 +02:00
..
2021-04-03 12:47:19 +02:00
2021-04-03 12:47:19 +02:00
2021-04-03 12:47:19 +02:00
2021-04-03 12:47:19 +02:00

callers-func-length

A simple benchmark that shows that the costs of stack unwinding in Go increase for larger functions. This is due to the way gopclntab based unwinding is implemented.

go test -bench .
goos: darwin
goarch: amd64
pkg: github.com/felixge/go-profiler-notes/examples/callers-func-length
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkCallers/short-12         	2623002	      454.1 ns/op
BenchmarkCallers/loop-12          	2590384	      466.8 ns/op
BenchmarkCallers/long-12          	 638096	     1862 ns/op