Skip to content

Commit

Permalink
feat: use ahash for better hash performance
Browse files Browse the repository at this point in the history
Signed-off-by: xiaguan <[email protected]>
  • Loading branch information
xiaguan committed Mar 15, 2024
1 parent ce4d4c6 commit e36f844
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 6 deletions.
38 changes: 36 additions & 2 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jemalloc = ["tikv-jemallocator"]
python = ["pyo3", "pyo3-build-config"]

[dependencies]
ahash = "0.8"
anyhow = "1"
async-recursion = "1"
async-stream = "0.3"
Expand Down Expand Up @@ -119,3 +120,6 @@ risinglight_proto = { path = "proto" }
[lib]
name = "risinglight"
crate-type = ["cdylib", "rlib"]

[profile.release]
debug = true
3 changes: 1 addition & 2 deletions src/executor/hash_agg.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2024 RisingLight Project Authors. Licensed under Apache-2.0.

use std::collections::HashMap;

use ahash::{HashMap, HashMapExt};
use iter_chunks::IterChunks;
use smallvec::SmallVec;

Expand Down
2 changes: 1 addition & 1 deletion src/executor/hash_join.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright 2024 RisingLight Project Authors. Licensed under Apache-2.0.

use std::collections::{HashMap, HashSet};
use std::marker::ConstParamTy;
use std::vec::Vec;

use ahash::{HashMap, HashMapExt, HashSet, HashSetExt};
use futures::TryStreamExt;
use smallvec::SmallVec;

Expand Down
2 changes: 1 addition & 1 deletion src/storage/secondary/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl ColumnIndex {
let checksum = footer.get_u64();
verify_checksum(checksum_type, index_data, checksum)?;

let mut indexes = vec![];
let mut indexes = Vec::with_capacity(length);
for _ in 0..length {
let index = BlockIndex::decode_length_delimited(&mut index_data)?;
indexes.push(index);
Expand Down

0 comments on commit e36f844

Please sign in to comment.