Skip to content

chore: updt benchmark file #889

chore: updt benchmark file

chore: updt benchmark file #889

Workflow file for this run

# act -W .github/workflows/benchmark.yml --container-architecture linux/amd64 -j benchmark -P ubuntu-latest=catthehacker/ubuntu:act-latest
name: Rust Benchmark
on: [push]
env:
CARGO_TERM_COLOR: always
jobs:
apple_ocr_benchmark:
name: Run Apple OCR benchmark
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: |
brew install ffmpeg
- name: Run OCR benchmarks
env:
DYLD_LIBRARY_PATH: ${{ github.workspace }}/screenpipe-vision/lib:${{ env.DYLD_LIBRARY_PATH }}
run: |
cargo bench --bench ocr_benchmark -- --output-format bencher | tee ocr_output.txt
- name: Store OCR benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Apple OCR Benchmark
tool: "cargo"
output-file-path: ocr_output.txt
external-data-json-path: ./cache/apple-ocr-benchmark-data.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: false
comment-always: false
save-data-file: true
- name: Upload Apple OCR benchmark artifact
uses: actions/upload-artifact@v3
with:
name: apple-ocr-benchmark-data
path: ./cache/apple-ocr-benchmark-data.json
tesseract_ocr_benchmark:
name: Run Tesseract OCR benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libleptonica-dev libtesseract-dev tesseract-ocr-eng
- name: Run Tesseract OCR benchmarks
run: |
cargo bench --bench ocr_benchmark -- --output-format bencher | tee tesseract_ocr_output.txt
- name: Store Tesseract OCR benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Tesseract OCR Benchmark
tool: "cargo"
output-file-path: tesseract_ocr_output.txt
external-data-json-path: ./cache/tesseract-ocr-benchmark-data.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: false
comment-always: false
save-data-file: true
- name: Upload Tesseract OCR benchmark artifact
uses: actions/upload-artifact@v3
with:
name: tesseract-ocr-benchmark-data
path: ./cache/tesseract-ocr-benchmark-data.json
windows_ocr_benchmark:
name: Run Windows OCR benchmark
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Run Windows OCR benchmarks
run: |
cargo bench --bench ocr_benchmark -- --output-format bencher | Tee-Object -FilePath windows_ocr_output.txt
- name: Store Windows OCR benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Windows OCR Benchmark
tool: "cargo"
output-file-path: windows_ocr_output.txt
external-data-json-path: ./cache/windows-ocr-benchmark-data.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: false
comment-always: false
save-data-file: true
- name: Upload Windows OCR benchmark artifact
uses: actions/upload-artifact@v3
with:
name: windows-ocr-benchmark-data
path: ./cache/windows-ocr-benchmark-data.json
analyze_benchmarks:
needs: [apple_ocr_benchmark, tesseract_ocr_benchmark, windows_ocr_benchmark]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download benchmark data
uses: actions/download-artifact@v3
with:
path: ./cache
- name: List contents of cache directory
run: ls -R ./cache
- name: Analyze Apple OCR benchmark
uses: benchmark-action/github-action-benchmark@v1
with:
tool: "cargo"
output-file-path: ./cache/apple-ocr-benchmark-data/apple-ocr-benchmark-data.json
external-data-json-path: ./cache/apple-ocr-benchmark-data.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: false
comment-always: false
fail-on-alert: false
- name: Analyze Tesseract OCR benchmark
uses: benchmark-action/github-action-benchmark@v1
with:
tool: "cargo"
output-file-path: ./cache/tesseract-ocr-benchmark-data/tesseract-ocr-benchmark-data.json
external-data-json-path: ./cache/tesseract-ocr-benchmark-data.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: false
comment-always: false
fail-on-alert: false
- name: Analyze Windows OCR benchmark
uses: benchmark-action/github-action-benchmark@v1
with:
tool: "cargo"
output-file-path: ./cache/windows-ocr-benchmark-data/windows-ocr-benchmark-data.json
external-data-json-path: ./cache/windows-ocr-benchmark-data.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
comment-on-alert: true
fail-on-alert: true
alert-threshold: "200%"
comment-always: true
alert-comment-cc-users: "@louis030195"