Skip to content

Commit

Permalink
Applied more constraint to optimal PFC and now stabilized new gap hash
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaCappelletti94 committed Sep 10, 2024
1 parent b937c62 commit 8bb3fb4
Show file tree
Hide file tree
Showing 17 changed files with 5,820 additions and 5,844 deletions.
16 changes: 14 additions & 2 deletions benches/hash_list_insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,19 @@ fn bench_hash_list_insert(c: &mut Criterion) {
b.iter(|| {
let mut result = false;
let mut switch: Switch = Switch::default();
for random_value in iter_random_values::<u64>(5_000, None, None) {
for random_value in iter_random_values::<u64>(3_000, None, None) {
result ^= switch.insert(black_box(&random_value));
}
let mut switch: Switch = Switch::default();
for random_value in iter_random_values::<u64>(3_000, None, Some(876865675675)) {
result ^= switch.insert(black_box(&random_value));
}
let mut switch: Switch = Switch::default();
for random_value in iter_random_values::<u64>(3_000, None, Some(9775546767677)) {
result ^= switch.insert(black_box(&random_value));
}
let mut switch: Switch = Switch::default();
for random_value in iter_random_values::<u64>(3_000, None, Some(8775746767677)) {
result ^= switch.insert(black_box(&random_value));
}
result
Expand All @@ -41,7 +53,7 @@ fn bench_hash_list_insert(c: &mut Criterion) {
b.iter(|| {
let mut result = false;
let mut switch: Gap = Gap::default();
for random_value in iter_random_values::<u64>(5_000, None, None) {
for random_value in iter_random_values::<u64>(12_000, None, None) {
result ^= switch.insert(black_box(&random_value));
}
result
Expand Down
90 changes: 45 additions & 45 deletions hash_list_correction/gap_hash_correction.csv
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
precision,bits,rate_of_improvement,uncorrected_error,corrected_error
4,4,42.57,0.08,0.00
4,5,68.28,0.14,0.00
4,6,118.80,0.18,0.00
5,4,203.14,0.09,0.00
5,5,88.23,0.15,0.00
5,6,48.70,0.15,0.00
6,4,88.69,0.09,0.00
6,5,125.92,0.11,0.00
6,6,199.76,0.14,0.00
7,4,77.68,0.06,0.00
7,5,199.65,0.09,0.00
7,6,214.13,0.11,0.00
8,4,219.06,0.06,0.00
8,5,153.82,0.08,0.00
8,6,174.89,0.11,0.00
9,4,246.56,0.05,0.00
9,5,328.39,0.08,0.00
9,6,316.97,0.10,0.00
10,4,198.52,0.05,0.00
10,5,207.31,0.07,0.00
10,6,297.96,0.10,0.00
11,4,217.05,0.05,0.00
11,5,392.29,0.07,0.00
11,6,381.61,0.09,0.00
12,4,297.76,0.05,0.00
12,5,389.11,0.07,0.00
12,6,478.48,0.09,0.00
13,4,386.24,0.05,0.00
13,5,687.81,0.07,0.00
13,6,575.99,0.09,0.00
14,4,708.34,0.04,0.00
14,5,486.73,0.07,0.00
14,6,545.40,0.09,0.00
15,4,584.70,0.04,0.00
15,5,711.15,0.07,0.00
15,6,805.15,0.09,0.00
16,4,926.54,0.04,0.00
16,5,899.20,0.07,0.00
16,6,1022.31,0.09,0.00
17,4,1129.63,0.04,0.00
17,5,815.33,0.06,0.00
17,6,1167.87,0.09,0.00
18,4,1335.07,0.04,0.00
18,5,1919.84,0.06,0.00
18,6,1868.06,0.09,0.00
4,4,88.86,0.10,0.00
4,5,114.84,0.19,0.00
4,6,321.85,0.21,0.00
5,4,374.00,0.10,0.00
5,5,171.85,0.15,0.00
5,6,91.44,0.15,0.00
6,4,237.23,0.09,0.00
6,5,88.95,0.10,0.00
6,6,140.74,0.12,0.00
7,4,95.07,0.06,0.00
7,5,105.34,0.08,0.00
7,6,191.71,0.10,0.00
8,4,107.41,0.04,0.00
8,5,138.87,0.05,0.00
8,6,196.99,0.06,0.00
9,4,217.83,0.02,0.00
9,5,330.99,0.03,0.00
9,6,399.49,0.04,0.00
10,4,68.54,0.02,0.00
10,5,142.40,0.02,0.00
10,6,208.17,0.03,0.00
11,4,192.85,0.01,0.00
11,5,154.71,0.02,0.00
11,6,250.10,0.02,0.00
12,4,196.71,0.01,0.00
12,5,308.11,0.01,0.00
12,6,390.63,0.02,0.00
13,4,244.59,0.01,0.00
13,5,242.39,0.01,0.00
13,6,448.92,0.01,0.00
14,4,346.10,0.01,0.00
14,5,278.19,0.01,0.00
14,6,629.92,0.01,0.00
15,4,529.22,0.00,0.00
15,5,275.43,0.01,0.00
15,6,1108.07,0.01,0.00
16,4,699.21,0.00,0.00
16,5,1037.62,0.01,0.00
16,6,740.38,0.01,0.00
17,4,634.79,0.00,0.00
17,5,718.83,0.00,0.00
17,6,490.78,0.01,0.00
18,4,549.52,0.00,0.00
18,5,447.08,0.00,0.00
18,6,1994.33,0.01,0.00
46 changes: 0 additions & 46 deletions hash_list_correction/gap_hash_correction_vbyte.csv

This file was deleted.

6 changes: 3 additions & 3 deletions hash_list_correction/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ where
CH: CompositeHash,
{
let iterations: u32 = if CH::Precision::EXPONENT < 9 {
500_000
4_000_000
} else if CH::Precision::EXPONENT < 10 {
50_000
1_000_000
} else {
64
1024
};

let progress_bar = multiprogress.add(ProgressBar::new(iterations as u64));
Expand Down
90 changes: 45 additions & 45 deletions hash_list_correction/switch_hash_correction.csv
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
precision,bits,rate_of_improvement,uncorrected_error,corrected_error
4,4,43.64,0.05,0.00
4,5,26.32,0.00,0.00
4,6,26.37,0.00,0.00
5,4,35.08,0.00,0.00
5,5,66.76,0.00,0.00
5,6,70.06,0.00,0.00
6,4,131.43,0.00,0.00
6,5,202.75,0.00,0.00
6,6,253.17,0.00,0.00
7,4,289.71,0.00,0.00
7,5,384.82,0.00,0.00
7,6,518.50,0.00,0.00
8,4,14.77,0.00,0.00
8,5,38.01,0.00,0.00
8,6,18.77,0.00,0.00
9,4,23.63,0.00,0.00
9,5,42.91,0.00,0.00
9,6,94.13,0.00,0.00
10,4,13.42,0.00,0.00
10,5,24.13,0.00,0.00
10,6,74.78,0.01,0.00
11,4,44.17,0.00,0.00
11,5,73.82,0.01,0.00
11,6,16.59,0.00,0.00
12,4,39.13,0.00,0.00
12,5,39.19,0.00,0.00
12,6,46.94,0.00,0.00
13,4,51.09,0.00,0.00
13,5,52.30,0.00,0.00
13,6,53.76,0.00,0.00
14,4,69.95,0.00,0.00
14,5,86.95,0.00,0.00
14,6,104.41,0.00,0.00
15,4,57.61,0.00,0.00
15,5,78.50,0.00,0.00
15,6,80.44,0.00,0.00
16,4,35.40,0.00,0.00
16,5,101.88,0.00,0.00
16,6,87.31,0.00,0.00
17,4,107.07,0.00,0.00
17,5,260.46,0.00,0.00
17,6,304.19,0.00,0.00
18,4,232.72,0.00,0.00
18,5,147.84,0.00,0.00
18,6,363.26,0.00,0.00
4,4,44.17,0.05,0.00
4,5,38.77,0.00,0.00
4,6,39.91,0.00,0.00
5,4,31.90,0.00,0.00
5,5,55.58,0.00,0.00
5,6,58.44,0.00,0.00
6,4,99.53,0.00,0.00
6,5,144.97,0.00,0.00
6,6,202.20,0.00,0.00
7,4,320.86,0.00,0.00
7,5,481.32,0.00,0.00
7,6,646.05,0.00,0.00
8,4,18.06,0.00,0.00
8,5,78.43,0.00,0.00
8,6,19.56,0.00,0.00
9,4,15.03,0.00,0.00
9,5,11.09,0.00,0.00
9,6,18.95,0.00,0.00
10,4,22.71,0.00,0.00
10,5,31.14,0.00,0.00
10,6,120.49,0.01,0.00
11,4,48.96,0.00,0.00
11,5,138.17,0.01,0.00
11,6,30.64,0.00,0.00
12,4,121.56,0.00,0.00
12,5,52.35,0.00,0.00
12,6,48.54,0.00,0.00
13,4,61.26,0.00,0.00
13,5,64.79,0.00,0.00
13,6,73.32,0.00,0.00
14,4,110.82,0.00,0.00
14,5,114.20,0.00,0.00
14,6,150.22,0.00,0.00
15,4,91.53,0.00,0.00
15,5,39.68,0.00,0.00
15,6,115.89,0.00,0.00
16,4,47.82,0.00,0.00
16,5,149.57,0.00,0.00
16,6,43.83,0.00,0.00
17,4,149.72,0.00,0.00
17,5,245.20,0.00,0.00
17,6,442.70,0.00,0.00
18,4,547.75,0.00,0.00
18,5,765.14,0.00,0.00
18,6,673.54,0.00,0.00
Binary file modified measure_variant/comparison.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion measure_variant/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type HLL2 = Hybrid<
GapHash<Precision18, Bits6>,
>;

const ITERATIONS: usize = 32;
const ITERATIONS: usize = 256;
const MINIMUM_CARDINALITY_FOR_SAMPLING: u64 = 0;
const MEASUREMENT_STEP: u64 = 1;

Expand Down
Loading

0 comments on commit 8bb3fb4

Please sign in to comment.