diff options
author | Genny <gen@nyble.dev> | 2020-11-06 23:33:01 -0600 |
---|---|---|
committer | Genny <gen@nyble.dev> | 2020-11-06 23:33:01 -0600 |
commit | c54872f011c135bbbc963f4a2b6b1d8ee4fa92bc (patch) | |
tree | 6ee047a5929fbd92a664c041b0596b53f58d59aa /benches/lzw_encode.rs | |
parent | 85b5d7de253f5f91dbca4047196e005856fd52de (diff) | |
download | gifed-c54872f011c135bbbc963f4a2b6b1d8ee4fa92bc.tar.gz gifed-c54872f011c135bbbc963f4a2b6b1d8ee4fa92bc.zip |
Add gif components
Diffstat (limited to 'benches/lzw_encode.rs')
-rw-r--r-- | benches/lzw_encode.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/benches/lzw_encode.rs b/benches/lzw_encode.rs new file mode 100644 index 0000000..33440b2 --- /dev/null +++ b/benches/lzw_encode.rs @@ -0,0 +1,13 @@ +use criterion::{black_box, criterion_group, criterion_main, Criterion}; +use rand::{thread_rng, Rng}; +use gifed::LZW; + +pub fn criterion_benchmark(c: &mut Criterion) { + let mut random = [0u8; 255]; + thread_rng().fill(&mut random[..]); + + c.bench_function("lzw encode 255bytes", |b| b.iter(|| LZW::encode(8, black_box(&random)))); +} + +criterion_group!(benches, criterion_benchmark); +criterion_main!(benches); \ No newline at end of file |