Skip to content

feat!: Revamp & optimize the way paths are stored#387

Merged
dmtrKovalenko merged 9 commits intomainfrom
feat/dirs
Apr 18, 2026
Merged

feat!: Revamp & optimize the way paths are stored#387
dmtrKovalenko merged 9 commits intomainfrom
feat/dirs

Conversation

@dmtrKovalenko
Copy link
Copy Markdown
Owner

@dmtrKovalenko dmtrKovalenko commented Apr 17, 2026

closes #285

This is a very crucial redesign that actually required a lot of
consideration to move forward but now it allows us to save a lot of RAM,
acutally improves query time and gives an ability to query directories
for free

@dmtrKovalenko dmtrKovalenko changed the title Feat/dirs feat!: Revamp & optimize the way paths are stored Apr 17, 2026
This is a very crucial redesign that actually required a lot of
consideration to move forward but now it allows us to save a lot of RAM,
acutally improves query time and gives an ability to query directories
for free
Comment thread crates/fff-core/src/score.rs Outdated
sort_and_paginate(results, context)
let t3 = std::time::Instant::now();

let result = sort_and_paginate(results, context);
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sort and pagiante should happen in the level above AFTER both arenas are processed

Comment thread crates/fff-core/src/score.rs Outdated

let result = sort_and_paginate(results, context);

let t4 = std::time::Instant::now();
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove all of those and the logging below

base_score / 5 * 2 // 40% bonus for exact filename match
base_score / 5 * 2
} else if is_filename_match {
// 16% bonus for fuzzy filename match that landed in the filename region.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

restore the comments from this function

Comment thread crates/fff-core/src/simd_path.rs Outdated
out.clear();

let dir_len = self.filename_offset as usize;
if dir_len == 0 {
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remve this check is uselses

Comment thread crates/fff-core/src/simd_path.rs Outdated
let fname_offset = self.filename_offset as usize;
let total = self.byte_len as usize;
let fname_len = total - fname_offset;
if fname_len == 0 {
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto remove

}
}

pub(crate) fn build_chunked_path_store_from_strings(
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mark as used by tests

Comment thread crates/fff-core/src/types.rs Outdated
/// Tombstone — file was deleted but index slot is preserved so
/// bigram indices for other files stay valid.
pub const DELETED: u8 = 1 << 1;
/// File was added after the last full reindex; its ChunkedString
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the metnion of chunked sting here

Comment thread crates/fff-core/src/types.rs
Comment thread crates/fff-core/src/types.rs Outdated
git_status: self.git_status,
flags: self.flags,
// Don't clone the content — the clone lazily re-creates it on demand
// on clone we have to reset the cointent lock
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

content - typo

Comment thread crates/fff-nvim/src/bin/grep_vs_rg.rs Outdated
/// 2. Full results fff collect-all vs rg full line output (N iterations)
/// 3. First-page fff paginated (50 results) vs rg telescope-style
/// (spawn, stream 50 lines, kill) the real UI scenario (N iterations)
/// 1. Raw engine speed --- fff count-only vs rg --count-matches (N iterations)
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this change

@dmtrKovalenko dmtrKovalenko merged commit cebacb3 into main Apr 18, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Excessive memory usage

1 participant