Skip to content

Commit a590205

Browse files
committed
add zip64support.tar.zst benchmark
1 parent 179ef39 commit a590205

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

benchmarks.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
{
22
"commands": {
33
"decompress-rs": [
4-
"./decompress rs silesia-small.tar"
4+
"./decompress rs silesia-small.tar.zst",
5+
"./decompress rs zip64support.tar.zst"
56
],
67
"decompress-c": [
7-
"./decompress c silesia-small.tar"
8+
"./decompress c silesia-small.tar.zst",
9+
"./decompress c zip64support.tar.zst"
810
]
911
},
1012
"render-versus-self": {
1113
"decompression (c vs rs)": {
12-
"silesia-small.tar": { "measure": "cycles", "before": { "command": "decompress-c", "index": 0 }, "after": { "command": "decompress-rs", "index": 0 } }
14+
"silesia-small.tar.zst": { "measure": "cycles", "before": { "command": "decompress-c", "index": 0 }, "after": { "command": "decompress-rs", "index": 0 } },
15+
"zip64support.tar.zst": { "measure": "cycles", "before": { "command": "decompress-c", "index": 1 }, "after": { "command": "decompress-rs", "index": 1 } }
1316
}
1417
},
1518
"render-versus-other": {
1619
"decompression (rs, other versus self)": {
1720
"measure": "cycles",
1821
"command": "decompress-rs",
1922
"rows": {
20-
"silesia-small.tar": 0
23+
"silesia-small.tar.zst": 0,
24+
"zip64support.tar.zst": 1
2125
}
2226
}
2327
}

test-libzstd-rs-sys/examples/decompress.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
use core::ffi::c_void;
2+
use std::borrow::Cow;
23

34
fn main() {
45
let mut it = std::env::args();
56

67
let _ = it.next().unwrap();
8+
let variant = it.next().unwrap();
9+
let file = it.next();
710

811
let silesia_small_tar_zst = include_bytes!("../../silesia-small.tar.zst");
9-
let input = silesia_small_tar_zst;
1012

11-
match it.next().unwrap().as_str() {
13+
let input: Cow<'_, [u8]> = match file {
14+
None => silesia_small_tar_zst.into(),
15+
Some(path) => std::fs::read(path).unwrap().into(),
16+
};
17+
18+
match variant.as_str() {
1219
"c" => {
13-
let err = c(input);
20+
let err = c(&input);
1421
assert_eq!(err, 0);
1522
}
1623
"rs" => {
17-
let err = rs(input);
24+
let err = rs(&input);
1825
assert_eq!(err, 0);
1926
}
2027
bad => panic!("invalid command {bad}"),

zip64support.tar.zst

3.61 MB
Binary file not shown.

0 commit comments

Comments
 (0)