Last active
May 30, 2019 08:00
-
-
Save life1347/fe79903dcad9673d8045ca24fccf5102 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ go run ./p7uGl0JZ_TR.go | |
NoEmbedStruct | |
without pool: 1.558109ms | |
with pool: 89.337184ms | |
EmbedStruct | |
without pool: 651.618531ms | |
with pool: 84.505615ms | |
# https://stackoverflow.com/questions/45003259/passing-an-optimization-flag-to-a-go-compiler | |
# -N : Disable optimizations | |
# -l : Disable inlining | |
$ go run -gcflags '-N -l' ./p7uGl0JZ_TR.go | |
NoEmbedStruct | |
without pool: 139.720966ms | |
with pool: 97.43476ms | |
EmbedStruct | |
without pool: 672.334312ms | |
with pool: 91.052924ms | |
# new(Data) 改寫成 Data{b:make([]byte, 1024)} | |
$ go run ./p7uGl0JZ_TR.go | |
NoEmbedStruct | |
without pool: 1.330158ms | |
with pool: 82.081171ms | |
EmbedStruct | |
without pool: 1.304114ms | |
with pool: 80.288109ms | |
$ go run -gcflags '-N -l' ./p7uGl0JZ_TR.go | |
NoEmbedStruct | |
without pool: 136.941637ms | |
with pool: 94.261001ms | |
EmbedStruct | |
without pool: 102.397449ms | |
with pool: 89.48266ms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment