Skip to content

Commit

Permalink
Run ETE benchmarks with MiMalloc and leave a note encouraging its usa…
Browse files Browse the repository at this point in the history
…ge (#399)

fixes #395
  • Loading branch information
robert3005 authored Jun 24, 2024
1 parent 5a1f628 commit 5c08a86
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 5 deletions.
20 changes: 20 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ uuid = "1.8.0"
walkdir = "2.5.0"
worker = "0.3.0"
zigzag = "0.1.0"
mimalloc = "0.1.42"

[workspace.lints.rust]
warnings = "deny"
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,16 @@ Vortex to model more complex arrays while still exposing a logical interface. Fo
`ChunkedArray` where the first chunk is run-length encoded and the second chunk is dictionary encoded.
In Arrow, `RunLengthArray` and `DictionaryArray` are separate incompatible types, and so cannot be combined in this way.

### Usage

For best performance we recommend using [MiMalloc](https://github.com/microsoft/mimalloc) as the application's
allocator.

```rust
#[global_allocator]
static GLOBAL_ALLOC: MiMalloc = MiMalloc;
```

## Contributing

Please see [CONTRIBUTING.md](CONTRIBUTING.md).
Expand All @@ -159,6 +169,7 @@ Please see [CONTRIBUTING.md](CONTRIBUTING.md).
In order to build vortex, you may also need to install the flatbuffer compiler (flatc):

### Mac

```bash
brew install flatbuffers
```
Expand Down
7 changes: 4 additions & 3 deletions bench-vortex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@ workspace = true
[dependencies]
arrow-array = { workspace = true }
arrow-select = { workspace = true }
bytes = { workspace = true }
bzip2 = { workspace = true }
csv = { workspace = true }
enum-iterator = { workspace = true }
flexbuffers = { workspace = true }
futures = { workspace = true }
humansize = { workspace = true }
itertools = { workspace = true }
lazy_static = { workspace = true }
log = { workspace = true }
mimalloc = { workspace = true }
parquet = { workspace = true, features = [] }
reqwest = { workspace = true }
serde = { workspace = true }
simplelog = { workspace = true }
tokio = { workspace = true, features = ["full"] }
uuid = { workspace = true, features = ["v4"] }
Expand All @@ -41,9 +45,6 @@ vortex-fastlanes = { path = "../encodings/fastlanes" }
vortex-ipc = { path = "../vortex-ipc" }
vortex-ree = { path = "../encodings/runend" }
vortex-roaring = { path = "../encodings/roaring" }
serde = { workspace = true }
bytes = { workspace = true }
flexbuffers = { workspace = true }

[dev-dependencies]
criterion = { workspace = true, features = ["html_reports", "async_tokio"] }
Expand Down
7 changes: 5 additions & 2 deletions bench-vortex/benches/random_access.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
use bench_vortex::reader::{take_parquet, take_vortex};
use bench_vortex::taxi_data::{taxi_data_parquet, taxi_data_vortex};
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use mimalloc::MiMalloc;
use tokio::runtime::Runtime;

#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;

fn random_access(c: &mut Criterion) {
let mut group = c.benchmark_group("random access");
group.sample_size(10);

let indices = [10, 11, 12, 13, 100_000, 3_000_000];

Expand All @@ -16,7 +19,7 @@ fn random_access(c: &mut Criterion) {
});

let taxi_parquet = taxi_data_parquet();
group.bench_function("arrow", |b| {
group.sample_size(10).bench_function("arrow", |b| {
b.iter(|| black_box(take_parquet(&taxi_parquet, &indices).unwrap()))
});
}
Expand Down

0 comments on commit 5c08a86

Please sign in to comment.