Skip to content

Commit

Permalink
helo
Browse files Browse the repository at this point in the history
  • Loading branch information
alankritdabral committed Nov 12, 2023
1 parent c3e7ce3 commit 14654ba
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 96 deletions.
97 changes: 97 additions & 0 deletions .github/workflows/bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,100 @@ jobs:
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "style: apply lint fixes"

Criterion_benchmarks:
name: Performance degradation
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'benchmark')
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Run json_like_bench
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
uses: boa-dev/[email protected]
with:
benchName: json_like_bench
defaultFeatures: false
branchName: ${{ github.base_ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Run impl_path_string_for_evaluation_context
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
uses: boa-dev/[email protected]
with:
benchName: impl_path_string_for_evaluation_context
defaultFeatures: false
branchName: ${{ github.base_ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Run data_loader_bench
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
uses: boa-dev/[email protected]
with:
benchName: data_loader_bench
defaultFeatures: false
branchName: ${{ github.base_ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Run request_template_bench
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
uses: boa-dev/[email protected]
with:
benchName: request_template_bench
defaultFeatures: false
branchName: ${{ github.base_ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Check Benchmark Changes
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
run: |
output=$(/home/runner/.cargo/bin/critcmp base changes)
echo "$output"
awk 'NR > 2 {
group=$1
base=$7
changes=$3
gsub(/[^\-0-9\.]/, "", changes)
gsub(/[^\-0-9\.]/, "", base)
if (changes != "" && base != "") {
diff = changes - base
percentage = (diff / base) * 100
if (percentage > 10) {
printf "Percentage change for %s exceeds 10%%: %.2f%%\n", group, percentage
exit 1
}
}
}' <<< "$output"
build_time_check:
name: Build time check
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, ':benchmark')
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install iai-callgrind-runner
run: cargo install --version 0.7.3 iai-callgrind-runner

- name: Install Valgrind
run: |
sudo apt-get update
sudo apt-get install valgrind
- name: Run Benchmarks
run: |
echo -n > benches/iai-callgrind/benchmarks.txt
cargo bench --bench json_like_bench_iai-callgrind -- --save-baseline change >> benches/iai-callgrind/benchmarks.txt
cargo bench --bench data_loader_bench_iai-callgrind -- --save-baseline change >> benches/iai-callgrind/benchmarks.txt
cargo bench --bench impl_path_string_for_evaluation_context_iai-callgrind -- --save-baseline change >> benches/iai-callgrind/benchmarks.txt
cargo bench --bench request_template_bench_iai-callgrind -- --save-baseline change >> benches/iai-callgrind/benchmarks.txt
- name: Manipulate Benchmark File
run: sed -i 's/ \{1,\}\([0-9]\)/\1/g' benches/iai-callgrind/benchmarks.txt

- name: Execute build_time_compare.sh
run: |
chmod +x .github/scripts/build_time_compare.sh
./.github/scripts/build_time_compare.sh
31 changes: 1 addition & 30 deletions .github/workflows/build_time_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,4 @@ on:
- published
jobs:
benchmark:
name: build_time_check
if: contains(github.event.pull_request.labels.*.name, ':benchmark')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install iai-callgrind-runner
run: cargo install --version 0.7.3 iai-callgrind-runner

- name: Install Valgrind
run: |
sudo apt-get update
sudo apt-get install valgrind
- name: Run Benchmarks
run: |
echo -n > benches/iai-callgrind/benchmarks.txt
cargo bench --bench json_like_bench_iai-callgrind -- --save-baseline change >> benches/iai-callgrind/benchmarks.txt
cargo bench --bench data_loader_bench_iai-callgrind -- --save-baseline change >> benches/iai-callgrind/benchmarks.txt
cargo bench --bench impl_path_string_for_evaluation_context_iai-callgrind -- --save-baseline change >> benches/iai-callgrind/benchmarks.txt
cargo bench --bench request_template_bench_iai-callgrind -- --save-baseline change >> benches/iai-callgrind/benchmarks.txt
- name: Manipulate Benchmark File
run: sed -i 's/ \{1,\}\([0-9]\)/\1/g' benches/iai-callgrind/benchmarks.txt

- name: Execute build_time_compare.sh
run: |
chmod +x .github/scripts/build_time_compare.sh
./.github/scripts/build_time_compare.sh

67 changes: 1 addition & 66 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Benchmarks and build time

on:
push:
branches:
- "**"
pull_request:
branches: [main]
types: [opened, reopened, synchronize]
Expand All @@ -15,66 +12,4 @@ on:
default: "main"

jobs:
Criterion_benchmarks:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'benchmark')
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Run json_like_bench
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
uses: boa-dev/[email protected]
with:
benchName: json_like_bench
defaultFeatures: false
branchName: ${{ github.base_ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Run impl_path_string_for_evaluation_context
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
uses: boa-dev/[email protected]
with:
benchName: impl_path_string_for_evaluation_context
defaultFeatures: false
branchName: ${{ github.base_ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Run data_loader_bench
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
uses: boa-dev/[email protected]
with:
benchName: data_loader_bench
defaultFeatures: false
branchName: ${{ github.base_ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Run request_template_bench
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
uses: boa-dev/[email protected]
with:
benchName: request_template_bench
defaultFeatures: false
branchName: ${{ github.base_ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Check Benchmark Changes
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
run: |
output=$(/home/runner/.cargo/bin/critcmp base changes)
echo "$output"
awk 'NR > 2 {
group=$1
base=$7
changes=$3
gsub(/[^\-0-9\.]/, "", changes)
gsub(/[^\-0-9\.]/, "", base)
if (changes != "" && base != "") {
diff = changes - base
percentage = (diff / base) * 100
if (percentage > 10) {
printf "Percentage change for %s exceeds 10%%: %.2f%%\n", group, percentage
exit 1
}
}
}' <<< "$output"

0 comments on commit 14654ba

Please sign in to comment.