Skip to content

Commit 5f738a8

Browse files
committed
Revert changes
1 parent 6c858b3 commit 5f738a8

2 files changed

Lines changed: 0 additions & 40 deletions

File tree

sa-index/src/sa_searcher.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -426,23 +426,9 @@ impl Searcher {
426426
if let BoundSearchResult::SearchResult((min_bound, max_bound)) = search_bound_result {
427427
// try all the partially matched suffixes and store the matching suffixes in an
428428
// array (stop when our max number of matches is reached)
429-
const ITER_PREFETCH_DISTANCE: usize = 16;
430429
let mut sa_index = min_bound;
431430
let t_iter = Instant::now();
432431
while sa_index < max_bound {
433-
// Text reads only occur when skip > 0 (check_prefix is called).
434-
// When skip == 0 the prefix check is short-circuited and there are
435-
// no random text accesses to hide, so we skip the extra sa.get() cost.
436-
if skip > 0 {
437-
let future_sa_index = sa_index + ITER_PREFETCH_DISTANCE;
438-
if future_sa_index < max_bound {
439-
let future_suffix = self.sa.get(future_sa_index) as usize;
440-
if future_suffix >= skip {
441-
self.proteins.text().prefetch(future_suffix - skip);
442-
}
443-
}
444-
}
445-
446432
let suffix = self.sa.get(sa_index) as usize;
447433

448434
if suffix >= skip {

text-compression/src/lib.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,6 @@ pub use traits::{WriteBinary, ReadBinary, ReadBinaryMmap};
1616
/// The 5-bit-to-char lookup table for mmap-backed ProteinText.
1717
const BIT5_TO_CHAR: &[u8; 27] = b"ABCDEFGHIKLMNOPQRSTUVWXYZ-$";
1818

19-
/// Non-blocking hardware prefetch hint: move the cache line containing `ptr` into L1.
20-
/// No-op on unsupported architectures.
21-
#[inline(always)]
22-
fn prefetch_read(ptr: *const u8) {
23-
#[cfg(target_arch = "x86_64")]
24-
unsafe { std::arch::x86_64::_mm_prefetch(ptr as *const i8, std::arch::x86_64::_MM_HINT_T0) }
25-
#[cfg(target_arch = "aarch64")]
26-
unsafe { std::arch::asm!("prfm pldl1keep, [{p}]", p = in(reg) ptr, options(nostack, preserves_flags, readonly)) }
27-
#[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))]
28-
let _ = ptr;
29-
}
30-
3119
/// Returns the number of bytes the BitArray data occupies for a given text length at 5 bits/value.
3220
pub fn bit_array_byte_size(text_length: usize) -> usize {
3321
let extra = if (text_length * 5).is_multiple_of(64) { 0 } else { 1 };
@@ -200,20 +188,6 @@ impl ProteinText {
200188
ProteinTextSlice::new(self, start, end)
201189
}
202190

203-
/// Non-blocking hardware prefetch hint for the cache line covering character `index`.
204-
/// At 5 bits/char a 64-byte cache line holds 102 characters, so a single hint covers
205-
/// the entire peptide window starting at `index`.
206-
/// No-op for in-memory text and on unsupported platforms.
207-
#[inline]
208-
pub fn prefetch(&self, index: usize) {
209-
if let ProteinText::MmapBacked { mmap, data_offset, .. } = self {
210-
let byte_off = data_offset + (index * 5 / 64) * 8;
211-
if byte_off + 8 <= mmap.len() {
212-
prefetch_read(&mmap[byte_off] as *const u8);
213-
}
214-
}
215-
}
216-
217191
}
218192

219193
impl WriteBinary for ProteinText {

0 commit comments

Comments
 (0)