Skip to content

Benchmarks

Benchmarks #16

Workflow file for this run

name: Benchmarks
on:
push:
branches:
- main
pull_request:
paths:
- .github/workflows/benchmarks.yml
- Cargo.*
- crates/voicevox_core/Cargo.toml
- crates/voicevox_core/benches/*.rs
- crates/voicevox_core/src/**
- crates/voicevox_core_python_api/Cargo.toml
- crates/voicevox_core_python_api/poetry.lock
- crates/voicevox_core_python_api/pyproject.toml
- crates/voicevox_core_python_api/python/benches/*.py
- crates/voicevox_core_python_api/python/voicevox_core/**
- crates/voicevox_core_python_api/src/**
workflow_dispatch:
jobs:
rust-api:
name: Rust API
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Rust toolchain, cache and cargo-codspeed binary
uses: moonrepo/setup-rust@v1
with:
bins: cargo-codspeed
cache-target: release
inherit-toolchain: true
- name: Set up test data
run: cargo check -vp test_util
- name: Build
run: cargo codspeed build -p voicevox_core --bench benches --features load-onnxruntime -m walltime
- name: Run the benchmarks
run: cargo codspeed run -m walltime
- name: Inspect
run: |
find . -name '.codspeed' -exec ls -lhR {} +
ls -lhR target/codspeed
- name: Run the benchmarks
uses: CodSpeedHQ/action@v4
if: false
with:
run: cargo codspeed run -m walltime
mode: walltime
env:
VOICEVOX_CORE_BENCH_CONFIG: |
{
"include-long-input-text": ${{ github.event_name != 'pull_request' }}
}
python-api:
name: Python API
runs-on: ubuntu-latest
if: false
steps:
# よくわからないがディスク容量が足りなくなることがあるため、
# とりあえずAndroid, .NET, Haskell関係のものだけ削除して容量を確保する。
# https://github.com/VOICEVOX/voicevox_core/issues/1167
- name: Save Disk Space
uses: jlumbroso/[email protected]
with:
large-packages: false
docker-images: false
tool-cache: false
swap-storage: false
- name: Checkout
uses: actions/checkout@v5
- name: Set up Rust toolchain and cache
uses: moonrepo/setup-rust@v1
with:
cache-target: release
inherit-toolchain: true
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install Poetry
run: pip install --upgrade poetry
- name: Set up test data
run: cargo check -vp test_util
- name: Build
working-directory: ./crates/voicevox_core_python_api
run: |
poetry install --with dev --with test
poetry run maturin develop --locked --profile release -v
- name: Run the benchmarks
uses: CodSpeedHQ/action@v4
with:
run: poetry run pytest ./python/benches/ --codspeed --codspeed-mode walltime
mode: walltime
working-directory: ./crates/voicevox_core_python_api