mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
ab3a7cb21f
Summary: In preparation for merging fb-mercurial sources to the Eden repository, move everything from the top-level directory into an `eden/scm` subdirectory.
30 lines
720 B
Rust
30 lines
720 B
Rust
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This software may be used and distributed according to the terms of the
|
|
* GNU General Public License version 2.
|
|
*/
|
|
|
|
use lz4_pyframe::{compress, decompress};
|
|
use minibench::{bench, elapsed};
|
|
use rand_core::{RngCore, SeedableRng};
|
|
|
|
fn main() {
|
|
let mut rng = rand_chacha::ChaChaRng::seed_from_u64(0);
|
|
let mut buf = vec![0u8; 100_000000];
|
|
rng.fill_bytes(&mut buf);
|
|
let compressed = compress(&buf).unwrap();
|
|
|
|
bench("compress (100M)", || {
|
|
elapsed(|| {
|
|
compress(&buf).unwrap();
|
|
})
|
|
});
|
|
|
|
bench("decompress (~100M)", || {
|
|
elapsed(|| {
|
|
decompress(&compressed).unwrap();
|
|
})
|
|
});
|
|
}
|