Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nnguyent/c2d0f8ccb9132122bd982af0be4ab28c to your computer and use it in GitHub Desktop.
Save nnguyent/c2d0f8ccb9132122bd982af0be4ab28c to your computer and use it in GitHub Desktop.

Revisions

  1. @arsham arsham revised this gist Jul 2, 2020. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion go_cpu_memory_profiling_benchmarks.sh
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,11 @@
    go test -run=. -bench=. -cpuprofile=cpu.out -benchmem -memprofile=mem.out -trace=trace.out
    go test -run=. -bench=. -benchtime=5s -count 5 -benchmem -cpuprofile=cpu.out -memprofile=mem.out -trace=trace.out ./package | tee bench.txt
    go tool pprof -http :8080 cpu.out
    go tool pprof -http :8081 mem.out
    go tool trace trace.out

    go tool pprof $FILENAME.test cpu.out
    # (pprof) list <func name>

    # go get -u golang.org/x/perf/cmd/benchstat
    benchstat bench.txt
    rm cpu.out mem.out trace.out *.test
  2. @arsham arsham revised this gist Jul 2, 2020. 1 changed file with 4 additions and 30 deletions.
    34 changes: 4 additions & 30 deletions go_cpu_memory_profiling_benchmarks.sh
    Original file line number Diff line number Diff line change
    @@ -1,35 +1,9 @@
    FILENAME=$(basename $(pwd))
    go test -run=. -bench=. -cpuprofile=cpu.out -benchmem -memprofile=mem.out -trace trace.out
    go tool pprof -pdf $FILENAME.test cpu.out > cpu.pdf && open cpu.pdf
    go tool pprof -pdf --alloc_space $FILENAME.test mem.out > alloc_space.pdf && open alloc_space.pdf
    go tool pprof -pdf --alloc_objects $FILENAME.test mem.out > alloc_objects.pdf && open alloc_objects.pdf
    go tool pprof -pdf --inuse_space $FILENAME.test mem.out > inuse_space.pdf && open inuse_space.pdf
    go tool pprof -pdf --inuse_objects $FILENAME.test mem.out > inuse_objects.pdf && open inuse_objects.pdf
    go test -run=. -bench=. -cpuprofile=cpu.out -benchmem -memprofile=mem.out -trace=trace.out
    go tool pprof -http :8080 cpu.out
    go tool pprof -http :8081 mem.out
    go tool trace trace.out

    go-torch $FILENAME.test cpu.out -f ${FILENAME}_cpu.svg && open ${FILENAME}_cpu.svg
    go-torch --alloc_objects $FILENAME.test mem.out -f ${FILENAME}_alloc_obj.svg && open ${FILENAME}_alloc_obj.svg
    go-torch --alloc_space $FILENAME.test mem.out -f ${FILENAME}_alloc_space.svg && open ${FILENAME}_alloc_space.svg
    go-torch --inuse_objects $FILENAME.test mem.out -f ${FILENAME}_inuse_obj.svg && open ${FILENAME}_inuse_obj.svg
    go-torch --inuse_space $FILENAME.test mem.out -f ${FILENAME}_inuse_space.svg && open ${FILENAME}_inuse_space.svg

    # For live data

    go-torch -u http://localhost:8080 --seconds 32 -f ${FILENAME}_live.svg && open ${FILENAME}_live.svg

    #

    go tool pprof -cum cpu.out
    go tool pprof -cum --alloc_space mem.out
    go tool pprof -cum --alloc_objects mem.out
    go tool pprof -cum --inuse_space mem.out
    go tool pprof -cum --inuse_objects mem.out

    #

    go tool pprof $FILENAME.test cpu.out
    # (pprof) list <func name>

    #

    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out cpu.pdf mem.out $FILENAME.test ${FILENAME}_cpu.svg ${FILENAME}_alloc_obj.svg ${FILENAME}_alloc_space.svg ${FILENAME}_inuse_obj.svg ${FILENAME}_inuse_space.svg ${FILENAME}_live.svg trace.out
    rm cpu.out mem.out trace.out *.test
  3. @arsham arsham revised this gist Oct 3, 2018. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions go_cpu_memory_profiling_benchmarks.sh
    Original file line number Diff line number Diff line change
    @@ -19,11 +19,11 @@ go-torch -u http://localhost:8080 --seconds 32 -f ${FILENAME}_live.svg && open $

    #

    go tool pprof -cum $FILENAME.test cpu.out
    go tool pprof -cum --alloc_space $FILENAME.test mem.out
    go tool pprof -cum --alloc_objects $FILENAME.test mem.out
    go tool pprof -cum --inuse_space $FILENAME.test mem.out
    go tool pprof -cum --inuse_objects $FILENAME.test mem.out
    go tool pprof -cum cpu.out
    go tool pprof -cum --alloc_space mem.out
    go tool pprof -cum --alloc_objects mem.out
    go tool pprof -cum --inuse_space mem.out
    go tool pprof -cum --inuse_objects mem.out

    #

  4. @arsham arsham revised this gist Jun 13, 2018. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions go_cpu_memory_profiling_benchmarks.sh
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,11 @@
    FILENAME=$(basename $(pwd))
    go test -run=. -bench=. -cpuprofile=cpu.out -benchmem -memprofile=mem.out
    go test -run=. -bench=. -cpuprofile=cpu.out -benchmem -memprofile=mem.out -trace trace.out
    go tool pprof -pdf $FILENAME.test cpu.out > cpu.pdf && open cpu.pdf
    go tool pprof -pdf --alloc_space $FILENAME.test mem.out > alloc_space.pdf && open alloc_space.pdf
    go tool pprof -pdf --alloc_objects $FILENAME.test mem.out > alloc_objects.pdf && open alloc_objects.pdf
    go tool pprof -pdf --inuse_space $FILENAME.test mem.out > inuse_space.pdf && open inuse_space.pdf
    go tool pprof -pdf --inuse_objects $FILENAME.test mem.out > inuse_objects.pdf && open inuse_objects.pdf
    go tool trace trace.out

    go-torch $FILENAME.test cpu.out -f ${FILENAME}_cpu.svg && open ${FILENAME}_cpu.svg
    go-torch --alloc_objects $FILENAME.test mem.out -f ${FILENAME}_alloc_obj.svg && open ${FILENAME}_alloc_obj.svg
    @@ -31,4 +32,4 @@ go tool pprof $FILENAME.test cpu.out

    #

    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out cpu.pdf mem.out $FILENAME.test ${FILENAME}_cpu.svg ${FILENAME}_alloc_obj.svg ${FILENAME}_alloc_space.svg ${FILENAME}_inuse_obj.svg ${FILENAME}_inuse_space.svg ${FILENAME}_live.svg
    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out cpu.pdf mem.out $FILENAME.test ${FILENAME}_cpu.svg ${FILENAME}_alloc_obj.svg ${FILENAME}_alloc_space.svg ${FILENAME}_inuse_obj.svg ${FILENAME}_inuse_space.svg ${FILENAME}_live.svg trace.out
  5. @arsham arsham renamed this gist Apr 2, 2018. 1 changed file with 1 addition and 1 deletion.
    Original file line number Diff line number Diff line change
    @@ -27,7 +27,7 @@ go tool pprof -cum --inuse_objects $FILENAME.test mem.out
    #

    go tool pprof $FILENAME.test cpu.out
    (pprof) list <func name>
    # (pprof) list <func name>

    #

  6. @arsham arsham revised this gist Apr 1, 2018. No changes.
  7. @arsham arsham revised this gist Mar 31, 2018. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions go cpu and memory profiling benchmarks
    Original file line number Diff line number Diff line change
    @@ -26,4 +26,9 @@ go tool pprof -cum --inuse_objects $FILENAME.test mem.out

    #

    go tool pprof $FILENAME.test cpu.out
    (pprof) list <func name>

    #

    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out cpu.pdf mem.out $FILENAME.test ${FILENAME}_cpu.svg ${FILENAME}_alloc_obj.svg ${FILENAME}_alloc_space.svg ${FILENAME}_inuse_obj.svg ${FILENAME}_inuse_space.svg ${FILENAME}_live.svg
  8. @arsham arsham revised this gist Mar 24, 2018. 1 changed file with 15 additions and 1 deletion.
    16 changes: 15 additions & 1 deletion go cpu and memory profiling benchmarks
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,29 @@
    FILENAME=$(basename $(pwd))
    go test -run=. -cpuprofile=cpu.out -benchmem -memprofile=mem.out
    go test -run=. -bench=. -cpuprofile=cpu.out -benchmem -memprofile=mem.out
    go tool pprof -pdf $FILENAME.test cpu.out > cpu.pdf && open cpu.pdf
    go tool pprof -pdf --alloc_space $FILENAME.test mem.out > alloc_space.pdf && open alloc_space.pdf
    go tool pprof -pdf --alloc_objects $FILENAME.test mem.out > alloc_objects.pdf && open alloc_objects.pdf
    go tool pprof -pdf --inuse_space $FILENAME.test mem.out > inuse_space.pdf && open inuse_space.pdf
    go tool pprof -pdf --inuse_objects $FILENAME.test mem.out > inuse_objects.pdf && open inuse_objects.pdf

    go-torch $FILENAME.test cpu.out -f ${FILENAME}_cpu.svg && open ${FILENAME}_cpu.svg
    go-torch --alloc_objects $FILENAME.test mem.out -f ${FILENAME}_alloc_obj.svg && open ${FILENAME}_alloc_obj.svg
    go-torch --alloc_space $FILENAME.test mem.out -f ${FILENAME}_alloc_space.svg && open ${FILENAME}_alloc_space.svg
    go-torch --inuse_objects $FILENAME.test mem.out -f ${FILENAME}_inuse_obj.svg && open ${FILENAME}_inuse_obj.svg
    go-torch --inuse_space $FILENAME.test mem.out -f ${FILENAME}_inuse_space.svg && open ${FILENAME}_inuse_space.svg

    # For live data

    go-torch -u http://localhost:8080 --seconds 32 -f ${FILENAME}_live.svg && open ${FILENAME}_live.svg

    #

    go tool pprof -cum $FILENAME.test cpu.out
    go tool pprof -cum --alloc_space $FILENAME.test mem.out
    go tool pprof -cum --alloc_objects $FILENAME.test mem.out
    go tool pprof -cum --inuse_space $FILENAME.test mem.out
    go tool pprof -cum --inuse_objects $FILENAME.test mem.out

    #

    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out cpu.pdf mem.out $FILENAME.test ${FILENAME}_cpu.svg ${FILENAME}_alloc_obj.svg ${FILENAME}_alloc_space.svg ${FILENAME}_inuse_obj.svg ${FILENAME}_inuse_space.svg ${FILENAME}_live.svg
  9. @arsham arsham revised this gist Oct 13, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion go cpu and memory profiling benchmarks
    Original file line number Diff line number Diff line change
    @@ -11,5 +11,5 @@ go-torch --alloc_space $FILENAME.test mem.out -f ${FILENAME}_alloc_space.svg &&
    go-torch --inuse_objects $FILENAME.test mem.out -f ${FILENAME}_inuse_obj.svg && open ${FILENAME}_inuse_obj.svg
    go-torch --inuse_space $FILENAME.test mem.out -f ${FILENAME}_inuse_space.svg && open ${FILENAME}_inuse_space.svg
    # For live data
    go-torch -u http://localhost:8080 -f ${FILENAME}_live.svg && open ${FILENAME}_live.svg
    go-torch -u http://localhost:8080 --seconds 32 -f ${FILENAME}_live.svg && open ${FILENAME}_live.svg
    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out cpu.pdf mem.out $FILENAME.test ${FILENAME}_cpu.svg ${FILENAME}_alloc_obj.svg ${FILENAME}_alloc_space.svg ${FILENAME}_inuse_obj.svg ${FILENAME}_inuse_space.svg ${FILENAME}_live.svg
  10. @arsham arsham revised this gist Oct 13, 2017. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion go cpu and memory profiling benchmarks
    Original file line number Diff line number Diff line change
    @@ -10,4 +10,6 @@ go-torch --alloc_objects $FILENAME.test mem.out -f ${FILENAME}_alloc_obj.svg &&
    go-torch --alloc_space $FILENAME.test mem.out -f ${FILENAME}_alloc_space.svg && open ${FILENAME}_alloc_space.svg
    go-torch --inuse_objects $FILENAME.test mem.out -f ${FILENAME}_inuse_obj.svg && open ${FILENAME}_inuse_obj.svg
    go-torch --inuse_space $FILENAME.test mem.out -f ${FILENAME}_inuse_space.svg && open ${FILENAME}_inuse_space.svg
    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out cpu.pdf mem.out $FILENAME.test ${FILENAME}_cpu.svg ${FILENAME}_alloc_obj.svg ${FILENAME}_alloc_space.svg ${FILENAME}_inuse_obj.svg ${FILENAME}_inuse_space.svg
    # For live data
    go-torch -u http://localhost:8080 -f ${FILENAME}_live.svg && open ${FILENAME}_live.svg
    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out cpu.pdf mem.out $FILENAME.test ${FILENAME}_cpu.svg ${FILENAME}_alloc_obj.svg ${FILENAME}_alloc_space.svg ${FILENAME}_inuse_obj.svg ${FILENAME}_inuse_space.svg ${FILENAME}_live.svg
  11. @arsham arsham revised this gist Oct 13, 2017. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions go cpu and memory profiling benchmarks
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,13 @@
    FILENAME=$(basename $(pwd))
    go test -run=. -bench=. -cpuprofile=cpu.out -benchmem -memprofile=mem.out
    go test -run=. -cpuprofile=cpu.out -benchmem -memprofile=mem.out
    go tool pprof -pdf $FILENAME.test cpu.out > cpu.pdf && open cpu.pdf
    go tool pprof -pdf --alloc_space $FILENAME.test mem.out > alloc_space.pdf && open alloc_space.pdf
    go tool pprof -pdf --alloc_objects $FILENAME.test mem.out > alloc_objects.pdf && open alloc_objects.pdf
    go tool pprof -pdf --inuse_space $FILENAME.test mem.out > inuse_space.pdf && open inuse_space.pdf
    go tool pprof -pdf --inuse_objects $FILENAME.test mem.out > inuse_objects.pdf && open inuse_objects.pdf
    go-torch $FILENAME.test cpu.out -f ${FILENAME}_cpu.svg && open ${FILENAME}_cpu.svg
    go-torch --alloc_objects $FILENAME.test mem.out -f ${FILENAME}_obj.svg && open ${FILENAME}_obj.svg
    go-torch --alloc_space $FILENAME.test mem.out -f ${FILENAME}_space.svg && open ${FILENAME}_space.svg
    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out cpu.pdf mem.out $FILENAME.test ${FILENAME}_cpu.svg ${FILENAME}_obj.svg ${FILENAME}_space.svg
    go-torch --alloc_objects $FILENAME.test mem.out -f ${FILENAME}_alloc_obj.svg && open ${FILENAME}_alloc_obj.svg
    go-torch --alloc_space $FILENAME.test mem.out -f ${FILENAME}_alloc_space.svg && open ${FILENAME}_alloc_space.svg
    go-torch --inuse_objects $FILENAME.test mem.out -f ${FILENAME}_inuse_obj.svg && open ${FILENAME}_inuse_obj.svg
    go-torch --inuse_space $FILENAME.test mem.out -f ${FILENAME}_inuse_space.svg && open ${FILENAME}_inuse_space.svg
    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out cpu.pdf mem.out $FILENAME.test ${FILENAME}_cpu.svg ${FILENAME}_alloc_obj.svg ${FILENAME}_alloc_space.svg ${FILENAME}_inuse_obj.svg ${FILENAME}_inuse_space.svg
  12. @arsham arsham revised this gist Oct 13, 2017. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions go cpu and memory profiling benchmarks
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,11 @@
    FILENAME=$(basename $(pwd))
    go test -run=^$ -bench=. -cpuprofile=cpu.out -benchmem -memprofile=mem.out
    go test -run=. -bench=. -cpuprofile=cpu.out -benchmem -memprofile=mem.out
    go tool pprof -pdf $FILENAME.test cpu.out > cpu.pdf && open cpu.pdf
    go tool pprof -pdf --alloc_space $FILENAME.test mem.out > alloc_space.pdf && open alloc_space.pdf
    go tool pprof -pdf --alloc_objects $FILENAME.test mem.out > alloc_objects.pdf && open alloc_objects.pdf
    go tool pprof -pdf --inuse_space $FILENAME.test mem.out > inuse_space.pdf && open inuse_space.pdf
    go tool pprof -pdf --inuse_objects $FILENAME.test mem.out > inuse_objects.pdf && open inuse_objects.pdf
    go-torch $FILENAME.test cpu.out -f $FILENAME.svg && open $FILENAME.svg
    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out cpu.pdf mem.out $FILENAME.test $FILENAME.svg
    go-torch $FILENAME.test cpu.out -f ${FILENAME}_cpu.svg && open ${FILENAME}_cpu.svg
    go-torch --alloc_objects $FILENAME.test mem.out -f ${FILENAME}_obj.svg && open ${FILENAME}_obj.svg
    go-torch --alloc_space $FILENAME.test mem.out -f ${FILENAME}_space.svg && open ${FILENAME}_space.svg
    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out cpu.pdf mem.out $FILENAME.test ${FILENAME}_cpu.svg ${FILENAME}_obj.svg ${FILENAME}_space.svg
  13. @arsham arsham revised this gist Oct 9, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion go cpu and memory profiling benchmarks
    Original file line number Diff line number Diff line change
    @@ -6,4 +6,4 @@ go tool pprof -pdf --alloc_objects $FILENAME.test mem.out > alloc_objects.pdf &&
    go tool pprof -pdf --inuse_space $FILENAME.test mem.out > inuse_space.pdf && open inuse_space.pdf
    go tool pprof -pdf --inuse_objects $FILENAME.test mem.out > inuse_objects.pdf && open inuse_objects.pdf
    go-torch $FILENAME.test cpu.out -f $FILENAME.svg && open $FILENAME.svg
    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out cpu.pdf mem.out $FILENAME.test torch.svg $FILENAME.svg
    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out cpu.pdf mem.out $FILENAME.test $FILENAME.svg
  14. @arsham arsham revised this gist Oct 8, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion go cpu and memory profiling benchmarks
    Original file line number Diff line number Diff line change
    @@ -6,4 +6,4 @@ go tool pprof -pdf --alloc_objects $FILENAME.test mem.out > alloc_objects.pdf &&
    go tool pprof -pdf --inuse_space $FILENAME.test mem.out > inuse_space.pdf && open inuse_space.pdf
    go tool pprof -pdf --inuse_objects $FILENAME.test mem.out > inuse_objects.pdf && open inuse_objects.pdf
    go-torch $FILENAME.test cpu.out -f $FILENAME.svg && open $FILENAME.svg
    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out mem.out $FILENAME.test torch.svg $FILENAME.svg
    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out cpu.pdf mem.out $FILENAME.test torch.svg $FILENAME.svg
  15. @arsham arsham revised this gist Oct 8, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion go cpu and memory profiling benchmarks
    Original file line number Diff line number Diff line change
    @@ -5,4 +5,5 @@ go tool pprof -pdf --alloc_space $FILENAME.test mem.out > alloc_space.pdf && ope
    go tool pprof -pdf --alloc_objects $FILENAME.test mem.out > alloc_objects.pdf && open alloc_objects.pdf
    go tool pprof -pdf --inuse_space $FILENAME.test mem.out > inuse_space.pdf && open inuse_space.pdf
    go tool pprof -pdf --inuse_objects $FILENAME.test mem.out > inuse_objects.pdf && open inuse_objects.pdf
    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out mem.out $FILENAME.test
    go-torch $FILENAME.test cpu.out -f $FILENAME.svg && open $FILENAME.svg
    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out mem.out $FILENAME.test torch.svg $FILENAME.svg
  16. @arsham arsham revised this gist Oct 8, 2017. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion go cpu and memory profiling benchmarks
    Original file line number Diff line number Diff line change
    @@ -1 +1,8 @@
    FILENAME=$(basename $(pwd)); go test -run=^$ -bench=. -cpuprofile=cpu.out -benchmem -memprofile=mem.out && go tool pprof -pdf $FILENAME.test cpu.out > cpu.pdf && open cpu.pdf && go tool pprof -pdf $FILENAME.test mem.out > mem.pdf && open mem.pdf
    FILENAME=$(basename $(pwd))
    go test -run=^$ -bench=. -cpuprofile=cpu.out -benchmem -memprofile=mem.out
    go tool pprof -pdf $FILENAME.test cpu.out > cpu.pdf && open cpu.pdf
    go tool pprof -pdf --alloc_space $FILENAME.test mem.out > alloc_space.pdf && open alloc_space.pdf
    go tool pprof -pdf --alloc_objects $FILENAME.test mem.out > alloc_objects.pdf && open alloc_objects.pdf
    go tool pprof -pdf --inuse_space $FILENAME.test mem.out > inuse_space.pdf && open inuse_space.pdf
    go tool pprof -pdf --inuse_objects $FILENAME.test mem.out > inuse_objects.pdf && open inuse_objects.pdf
    rm alloc_space.pdf alloc_objects.pdf inuse_space.pdf inuse_objects.pdf cpu.out mem.out $FILENAME.test
  17. @arsham arsham created this gist Jan 2, 2017.
    1 change: 1 addition & 0 deletions go cpu and memory profiling benchmarks
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    FILENAME=$(basename $(pwd)); go test -run=^$ -bench=. -cpuprofile=cpu.out -benchmem -memprofile=mem.out && go tool pprof -pdf $FILENAME.test cpu.out > cpu.pdf && open cpu.pdf && go tool pprof -pdf $FILENAME.test mem.out > mem.pdf && open mem.pdf