Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make mp4 parsing **a lot** faster & tremendously lower memory overhead #7860

Merged
merged 13 commits into from
Oct 22, 2024
1 change: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6181,6 +6181,7 @@ name = "re_video"
version = "0.20.0-alpha.1+dev"
dependencies = [
"cfg_aliases 0.2.1",
"criterion",
"crossbeam",
"econtext",
"indicatif",
Expand Down
7 changes: 6 additions & 1 deletion crates/store/re_video/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ dav1d = { workspace = true, optional = true, default-features = false, features

[dev-dependencies]
indicatif.workspace = true

criterion.workspace = true

# For build.rs:
[build-dependencies]
Expand All @@ -71,3 +71,8 @@ cfg_aliases.workspace = true

[[example]]
name = "frames"


[[bench]]
name = "video_load_bench"
harness = false
15 changes: 15 additions & 0 deletions crates/store/re_video/benches/video_load_bench.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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");
jprochazk marked this conversation as resolved.
Show resolved Hide resolved
c.bench_function("video_load", |b| {
b.iter_batched(
|| {},
|()| re_video::VideoData::load_from_bytes(video, "video/mp4"),
criterion::BatchSize::LargeInput,
);
});
}

criterion_group!(benches, video_load);
criterion_main!(benches);
Loading