]> Cypherpunks repositories - gostls13.git/commit
runtime: add simple malloc benchmarks
authorDmitriy Vyukov <dvyukov@google.com>
Wed, 15 May 2013 17:22:32 +0000 (21:22 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Wed, 15 May 2013 17:22:32 +0000 (21:22 +0400)
commit915784e11a58189524c9797ad5e1c1fc43eb632b
tree692823187905536f803b32c764bade16cd203248
parentee66972dce0afc5a0cf86be17d6e79cab418f701
runtime: add simple malloc benchmarks
Allocs of size 16 can bypass atomic set of the allocated bit, while allocs of size 8 can not.
Allocs with and w/o type info hit different paths inside of malloc.
Current results on linux/amd64:
BenchmarkMalloc8 50000000         43.6 ns/op
BenchmarkMalloc16 50000000         46.7 ns/op
BenchmarkMallocTypeInfo8 50000000         61.3 ns/op
BenchmarkMallocTypeInfo16 50000000         63.5 ns/op

R=golang-dev, remyoudompheng, minux.ma, bradfitz, iant
CC=golang-dev
https://golang.org/cl/9090045
src/pkg/runtime/malloc_test.go [new file with mode: 0644]