-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
0ef3a81
commit 6a01526
Showing
4 changed files
with
86 additions
and
21 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,59 @@ | ||
name: benchmark | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
linux: | ||
runs-on: ubuntu-24.04 | ||
name: memory consumption | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build environment | ||
run: | | ||
docker build -f Benchmarks/Memory/Dockerfile -t benchmark . | ||
- name: Build test application | ||
run: | | ||
docker run --rm -v=$PWD:/swift -w=/swift \ | ||
benchmark \ | ||
swift build -c release --product FirewallUsage | ||
- name: Build firewall | ||
run: | | ||
docker run --rm -v=$PWD:/swift -w=/swift \ | ||
-e IPINFO_TOKEN=${{ secrets.IPINFO_TOKEN }} \ | ||
benchmark \ | ||
Scripts/Package | ||
- name: Run test application (300MB memory limit) | ||
run: | | ||
docker run --rm -v=$PWD:/swift -w=/swift \ | ||
--memory-swap 300m \ | ||
--memory 300m \ | ||
-e LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 \ | ||
benchmark \ | ||
.build/release/FirewallUsage 66.249.66.169 | ||
- name: Run test application (200MB memory limit) | ||
run: | | ||
docker run --rm -v=$PWD:/swift -w=/swift \ | ||
--memory-swap 200m \ | ||
--memory 200m \ | ||
-e LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 \ | ||
benchmark \ | ||
.build/release/FirewallUsage 66.249.66.169 | ||
- name: Run test application (160MB memory limit) | ||
run: | | ||
docker run --rm -v=$PWD:/swift -w=/swift \ | ||
--memory-swap 160m \ | ||
--memory 160m \ | ||
-e LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 \ | ||
benchmark \ | ||
.build/release/FirewallUsage 66.249.66.169 |
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,4 @@ | ||
FROM swift:6.0.2-noble | ||
|
||
RUN apt update | ||
RUN apt -y install libjemalloc2 curl gzip |
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
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