Skip to content

Commit 03e9533

Browse files
authored
Stream EC reads by cell (#107)
1 parent 0a0f0cc commit 03e9533

File tree

5 files changed

+277
-224
lines changed

5 files changed

+277
-224
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ See the [Python README](./python/README.md)
7676
Some of the benchmarks compare performance to the JVM based client through libhdfs via the fs-hdfs3 crate. Because of that, some extra setup is required to run the benchmarks:
7777

7878
```bash
79-
export HADOOP_CONF_DIR=$(pwd)/crates/hdfs-native/target/test
79+
export HADOOP_CONF_DIR=$(pwd)/rust/target/test
8080
export CLASSPATH=$(hadoop classpath)
8181
```
8282

rust/benches/io.rs

+9-10
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,21 @@ fn bench(c: &mut Criterion) {
3535
.build()
3636
.unwrap();
3737

38+
rt.block_on(async { write_file(&client, "/bench", ints_to_write).await });
39+
3840
let mut group = c.benchmark_group("read");
3941
group.throughput(Throughput::Bytes((ints_to_write * 4) as u64));
40-
group.sample_size(10);
42+
group.sample_size(50);
4143

4244
group.bench_function("read-native", |b| {
43-
rt.block_on(async { write_file(&client, "/bench", ints_to_write).await });
44-
let reader = rt.block_on(client.read("/bench")).unwrap();
4545
b.to_async(&rt).iter(|| async {
46-
// let reader = client.read("/bench").await.unwrap();
46+
let reader = client.read("/bench").await.unwrap();
4747

4848
reader.read_range(0, reader.file_length()).await.unwrap()
4949
})
5050
});
51-
group.sample_size(10);
51+
group.sample_size(50);
5252
group.bench_function("read-libhdfs", |b| {
53-
rt.block_on(async { write_file(&client, "/bench", ints_to_write).await });
5453
let fs = get_hdfs().unwrap();
5554
b.iter(|| {
5655
let mut buf = BytesMut::zeroed(ints_to_write * 4);
@@ -69,18 +68,18 @@ fn bench(c: &mut Criterion) {
6968

7069
drop(group);
7170

71+
rt.block_on(async { write_file(&client, "/ec-3-2/bench", ints_to_write).await });
72+
7273
let mut group = c.benchmark_group("read-ec");
7374
group.throughput(Throughput::Bytes((ints_to_write * 4) as u64));
74-
group.sample_size(10);
75+
group.sample_size(50);
7576
group.bench_function("read-native", |b| {
76-
rt.block_on(async { write_file(&client, "/ec-3-2/bench", ints_to_write).await });
7777
let reader = rt.block_on(client.read("/ec-3-2/bench")).unwrap();
7878
b.to_async(&rt)
7979
.iter(|| async { reader.read_range(0, reader.file_length()).await.unwrap() })
8080
});
81-
group.sample_size(10);
81+
group.sample_size(50);
8282
group.bench_function("read-libhdfs", |b| {
83-
rt.block_on(async { write_file(&client, "/ec-3-2/bench", ints_to_write).await });
8483
let fs = get_hdfs().unwrap();
8584
b.iter(|| {
8685
let mut buf = BytesMut::zeroed(ints_to_write * 4);

0 commit comments

Comments
 (0)