-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
205 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: memory | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
memory: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install packages | ||
run: sudo apt update -y && sudo apt-get install -y csvkit datamash | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.22' | ||
check-latest: true | ||
- uses: actions/checkout@v4 | ||
- name: go mod tidy | ||
run: | | ||
mkdir bench | ||
cd bench | ||
awk '{if($0 ~ "// gcpause.go"){a=1;b=1};if($0 ~ "```" && b=1){b=0};if (a&&b) {print}}' ../README.md > gcpause.go | ||
go mod init bench | ||
go mod tidy | ||
go mod edit -replace github.com/phuslu/lru=../ | ||
cat go.mod | ||
- name: GC Tests | ||
working-directory: ./bench | ||
run: | | ||
echo -e 'MemStats\tCacheSize\tAlloc\tTotalAlloc\tSys' > gcpause.txt | ||
for name in nottl phuslu lxzan ristretto freelru ecache otter theine cloudflare ccache hashicorp; do | ||
for cachesize in 100000 200000 400000 1000000; do | ||
go run gcpause.go $name $cachesize >> gcpause.txt | ||
done | ||
done | ||
cat gcpause.txt | ||
- name: GC Results | ||
working-directory: ./bench | ||
run: | | ||
cat gcpause.txt | datamash --header-in crosstab 1,2 unique 3 | tee >(head -1) | tail -n +2 | sort -k12 -n | datamash transpose | tee >(head -1) | tail -n +2 | sort -n | datamash transpose | csvlook |
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