Skip to content

Commit

Permalink
fix: hash_table_sizing, inline hints, lint rule
Browse files Browse the repository at this point in the history
* Fix HASH_TABLE_SIZE to match comment again
* Remove `inline(never)` hints that were added to enable profiling
* Remove lint override that should not have been committed
  • Loading branch information
a10y committed Sep 3, 2024
1 parent bca81cb commit 3303175
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ impl CompressorBuilder {
///
/// Also returns the lengths vector, which is of length `n_symbols` and contains the
/// length for each of the values.
#[inline(never)]
fn finalize(&mut self) -> (u8, Vec<u8>) {
// Create a cumulative sum of each of the elements of the input line numbers.
// Do a map that includes the previously seen value as well.
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ impl Compressor {
/// # Safety
///
/// `out_ptr` must never be NULL or otherwise point to invalid memory.
#[inline(never)]
pub unsafe fn compress_word(&self, word: u64, out_ptr: *mut u8) -> (usize, usize) {
// Speculatively write the first byte of `word` at offset 1. This is necessary if it is an escape, and
// if it isn't, it will be overwritten anyway.
Expand Down
8 changes: 2 additions & 6 deletions src/lossy_pht.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
// TODO: remove
#![allow(unused)]

use std::fmt::Debug;

use crate::builder::fsst_hash;
use crate::Code;
use crate::Symbol;
use crate::FSST_CODE_MASK;
use crate::{Code, FSST_CODE_UNUSED};

/// Size of the perfect hash table.
///
/// NOTE: this differs from the paper, which recommends a 64KB total
/// table size. The paper does not account for the fact that most
/// vendors split the L1 cache into 32KB of instruction and 32KB of data.
pub const HASH_TABLE_SIZE: usize = 1 << 12;
pub const HASH_TABLE_SIZE: usize = 1 << 11;

/// A single entry in the [Lossy Perfect Hash Table][`LossyPHT`].
///
Expand Down

0 comments on commit 3303175

Please sign in to comment.