Skip to content

Commit

Permalink
make it a thing
Browse files Browse the repository at this point in the history
  • Loading branch information
jprochazk committed Oct 22, 2024
1 parent f735952 commit 800ad13
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/reusable_bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ jobs:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}

- uses: prefix-dev/[email protected]
with:
pixi-version: v0.25.0
# Only has the deps for round-trips. Not all examples.
environments: wheel-test-min

- name: Download test assets
run: pixi run -e wheel-test-min python ./tests/assets/download_test_assets.py

- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${{github.sha}} | cut -c1-7`" >> $GITHUB_ENV

Expand All @@ -87,6 +96,7 @@ jobs:
-p re_log_encoding \
-p re_query \
-p re_tuid \
-p re_video \
-- --output-format=bencher | tee /tmp/${{ env.SHORT_SHA }}
- name: "Set up Cloud SDK"
Expand Down
14 changes: 12 additions & 2 deletions crates/store/re_video/benches/video_load_bench.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
use std::path::Path;

use criterion::{criterion_group, criterion_main, Criterion};

fn video_load(c: &mut Criterion) {
let video = include_bytes!("../../../../tests/assets/video/Big_Buck_Bunny_1080_10s_av1.mp4");
let video_path = Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
.unwrap()
.parent()
.unwrap()
.parent()
.unwrap()
.join("tests/assets/video/Big_Buck_Bunny_1080_10s_av1.mp4");
let video = std::fs::read(video_path).unwrap();
c.bench_function("video_load", |b| {
b.iter_batched(
|| {},
|()| re_video::VideoData::load_from_bytes(video, "video/mp4"),
|()| re_video::VideoData::load_from_bytes(&video, "video/mp4"),
criterion::BatchSize::LargeInput,
);
});
Expand Down

0 comments on commit 800ad13

Please sign in to comment.