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

ref(replay): More efficient deserialization #1782

Merged
merged 20 commits into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 81 additions & 50 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion relay-general/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ utf16string = "0.2.0"
uuid = { version = "0.8.1", features = ["v4", "serde"] }

[dev-dependencies]
criterion = "0.3"
criterion = "0.4"
insta = { version = "1.19.0", features = ["json", "redactions", "ron", "yaml"] }
pretty-hex = "0.2.0"
similar-asserts = "1.4.2"
Expand Down
2 changes: 1 addition & 1 deletion relay-metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ thiserror = "1.0.20"
tokio = { version = "1.0", features = ["macros", "time"] }

[dev-dependencies]
criterion = "0.3"
criterion = "0.4"
insta = "1.19.0"
relay-statsd = { path = "../relay-statsd", features = ["test"] }
relay-test = { path = "../relay-test" }
Expand Down
5 changes: 5 additions & 0 deletions relay-replays/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,10 @@ unicase = "2.6.0"
flate2 = "1.0.19"

[dev-dependencies]
criterion = "0.4"
jan-auer marked this conversation as resolved.
Show resolved Hide resolved
insta = { version = "1.1.0", features = ["ron"] }
assert-json-diff = "2.0.2"

[[bench]]
name = "benchmarks"
harness = false
14 changes: 14 additions & 0 deletions relay-replays/benches/benchmarks.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};

use relay_replays::recording::_deserialize_event;

fn bench_recording(c: &mut Criterion) {
let payload = include_bytes!("../tests/fixtures/rrweb.json");

c.bench_with_input(BenchmarkId::new("rrweb", 1), &payload, |b, &_| {
b.iter(|| _deserialize_event(payload));
});
}

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