diff options
Diffstat (limited to 'json/profile')
-rw-r--r-- | json/profile/cpuprofile.bat | 2 | ||||
-rw-r--r-- | json/profile/json.go | 4 | ||||
-rw-r--r-- | json/profile/memprofile.bat | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/json/profile/cpuprofile.bat b/json/profile/cpuprofile.bat index 2899eb3..c293b5e 100644 --- a/json/profile/cpuprofile.bat +++ b/json/profile/cpuprofile.bat @@ -1,3 +1,3 @@ go build profile.exe -cpuprofile cpu.out -go tool pprof --inuse_objects profile.exe cpu.out +go tool pprof profile.exe cpu.out diff --git a/json/profile/json.go b/json/profile/json.go index b94848b..a03d047 100644 --- a/json/profile/json.go +++ b/json/profile/json.go @@ -31,11 +31,13 @@ func main() { } }() } + max := 1000000 if *memprofile != "" { runtime.MemProfileRate = 1 + max = 10000 } - for i := 0; i < 10000; i++ { + for i := 0; i < max; i++ { _, err := json.Unmarshal(`{"true":true, "false":false, "null": null}`) if err != nil { panic(err) diff --git a/json/profile/memprofile.bat b/json/profile/memprofile.bat index a9c935e..71873ac 100644 --- a/json/profile/memprofile.bat +++ b/json/profile/memprofile.bat @@ -1,3 +1,3 @@ go build profile.exe -memprofile mem.out -go tool pprof --inuse_objects profile.exe mem.out +go tool pprof profile.exe mem.out |