Files
AFFiNE-Mirror/packages/common/y-octo/utils/benches/update_benchmarks.rs
DarkSky ca2462f987 feat(native): sync yocto codes (#14243)
#### PR Dependency Tree


* **PR #14243** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Batch management API for coordinated document mutations and change
tracking.
* New document accessors (IDs, state snapshots, change/delete set
queries) and subscriber count.

* **Chores**
  * Upgraded Rust edition across packages to 2024.
  * Repository-wide formatting, stylistic cleanups and test adjustments.

* **Breaking Changes**
* Removed the Node native bindings package and its JS/TS declarations
and tests (no longer published/available).

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-11 06:08:33 +08:00

34 lines
793 B
Rust

mod utils;
use std::time::Duration;
use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_main};
use path_ext::PathExt;
use utils::Files;
fn update(c: &mut Criterion) {
let files = Files::load();
let mut group = c.benchmark_group("update");
group.measurement_time(Duration::from_secs(15));
for file in &files.files {
group.throughput(Throughput::Bytes(file.content.len() as u64));
group.bench_with_input(
BenchmarkId::new("parse with yrs", file.path.name_str()),
&file.content,
|b, content| {
b.iter(|| {
use yrs::{Update, updates::decoder::Decode};
Update::decode_v1(content).unwrap()
});
},
);
}
group.finish();
}
criterion_group!(benches, update);
criterion_main!(benches);