Skip to content

Commit

Permalink
refactor key len
Browse files Browse the repository at this point in the history
  • Loading branch information
XiangpengHao committed Oct 25, 2024
1 parent 2bcdd85 commit b1e3fb3
Show file tree
Hide file tree
Showing 12 changed files with 260 additions and 382 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Congee aims to be a simple and reliable **primitive** for building database syst

### Example:
```rust
use congee::Art;
let art = Art::default();
use congee::Congee;
let art = Congee::default();
let guard = art.pin(); // enter an epoch

art.insert(0, 42, &guard); // insert a value
Expand Down
6 changes: 3 additions & 3 deletions bench/basic.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use congee::Art;
use congee::Congee;
use rand::{thread_rng, Rng};
use serde::{Deserialize, Serialize};
use shumai::{config, ShumaiBench};
Expand Down Expand Up @@ -75,7 +75,7 @@ trait DBIndex: Send + Sync {
) -> usize;
}

impl DBIndex for Art<usize, usize> {
impl DBIndex for Congee<usize, usize> {
type Guard<'a> = crossbeam_epoch::Guard;

fn pin(&self) -> Self::Guard<'_> {
Expand Down Expand Up @@ -302,7 +302,7 @@ fn main() {
}
IndexType::ART => {
let mut test_bench = TestBench {
index: Art::default(),
index: Congee::default(),
initial_cnt: 100_000_000,
};
let result = shumai::run(&mut test_bench, c, repeat);
Expand Down
6 changes: 3 additions & 3 deletions bench/scan.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::HashSet;

use congee::Art;
use congee::Congee;
use rand::{prelude::Distribution, thread_rng, Rng};
use shumai::{config, ShumaiBench};

Expand All @@ -17,7 +17,7 @@ pub struct Scan {
}

struct TestBench {
index: Art<usize, usize>,
index: Congee<usize, usize>,
initial_cnt: usize,
}

Expand Down Expand Up @@ -80,7 +80,7 @@ fn main() {

for c in config.iter() {
let mut test_bench = TestBench {
index: Art::default(),
index: Congee::default(),
initial_cnt: 50_000_000,
};
let result = shumai::run(&mut test_bench, c, repeat);
Expand Down
5 changes: 4 additions & 1 deletion src/base_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ use crate::{
};

pub(crate) const MAX_KEY_LEN: usize = 8;
pub(crate) type Prefix = [u8; MAX_KEY_LEN];

/// Prefix has to be 8 bytes for better alignment.
const MAX_PREFIX_LEN: usize = 8;
pub(crate) type Prefix = [u8; MAX_PREFIX_LEN];

#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
Expand Down
134 changes: 0 additions & 134 deletions src/key.rs

This file was deleted.

Loading

0 comments on commit b1e3fb3

Please sign in to comment.