File: profile.sh

package info (click to toggle)
golang-github-jedib0t-go-pretty 6.2.4-1~bpo11%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye-backports
  • size: 1,168 kB
  • sloc: makefile: 31; sh: 14
file content (21 lines) | stat: -rwxr-xr-x 550 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

# cleanup the profile directory before starting
rm -fr profile

# profile each supported package
for what in "list" "progress" "table"
do
    echo "Profiling ${what} ..."
    mkdir -p profile/${what}
    go build -o profile/${what}/${what} cmd/profile-${what}/profile.go
    (cd profile/${what} && \
        ./${what} && \
        go tool pprof -pdf ${what} cpu.pprof > ../${what}.cpu.pdf && \
        go tool pprof -pdf ${what} mem.pprof > ../${what}.mem.pdf)
    echo "Profiling ${what} ... done!"
    echo
done

ls -al profile/*.pdf