Compare commits

...

2 Commits

Author SHA1 Message Date
ychhabria
c9ac1ccc27 Tune file search defaults from eval sweep 2026-03-24 03:08:29 -07:00
ychhabria
b419886760 Raise standalone file search limit to 50 2026-03-23 23:52:02 -07:00
5 changed files with 18 additions and 9 deletions

View File

@@ -15,8 +15,8 @@ use tracing::warn;
use crate::outgoing_message::OutgoingMessageSender;
const MATCH_LIMIT: usize = 50;
const MAX_THREADS: usize = 12;
const MATCH_LIMIT: usize = 100;
const MAX_THREADS: usize = 8;
pub(crate) async fn run_fuzzy_file_search(
query: String,

View File

@@ -13,7 +13,7 @@ pub struct Cli {
pub json: bool,
/// Maximum number of results to return.
#[clap(long, short = 'l', default_value = "64")]
#[clap(long, short = 'l', default_value = "100")]
pub limit: NonZero<usize>,
/// Directory to search.
@@ -25,12 +25,11 @@ pub struct Cli {
pub compute_indices: bool,
// While it is common to default to the number of logical CPUs when creating
// a thread pool, empirically, the I/O of the filetree traversal offers
// limited parallelism and is the bottleneck, so using a smaller number of
// threads is more efficient. (Empirically, using more than 2 threads doesn't seem to provide much benefit.)
// a thread pool, empirically, 8 worker threads was the fastest setting in
// local monorepo evals among the best-performing quality tiers.
//
/// Number of worker threads to use.
#[clap(long, default_value = "2")]
#[clap(long, default_value = "8")]
pub threads: NonZero<usize>,
/// Exclude patterns

View File

@@ -116,10 +116,10 @@ impl Default for FileSearchOptions {
fn default() -> Self {
Self {
#[expect(clippy::unwrap_used)]
limit: NonZero::new(20).unwrap(),
limit: NonZero::new(100).unwrap(),
exclude: Vec::new(),
#[expect(clippy::unwrap_used)]
threads: NonZero::new(2).unwrap(),
threads: NonZero::new(8).unwrap(),
compute_indices: false,
respect_gitignore: true,
}

View File

@@ -6,6 +6,7 @@
//! on every keystroke, and drops the session when the query becomes empty.
use codex_file_search as file_search;
use std::num::NonZero;
use std::path::PathBuf;
use std::sync::Arc;
use std::sync::Mutex;
@@ -13,6 +14,8 @@ use std::sync::Mutex;
use crate::app_event::AppEvent;
use crate::app_event_sender::AppEventSender;
const FILE_SEARCH_LIMIT: usize = 100;
pub(crate) struct FileSearchManager {
state: Arc<Mutex<SearchState>>,
search_dir: PathBuf,
@@ -83,6 +86,8 @@ impl FileSearchManager {
let session = file_search::create_session(
vec![self.search_dir.clone()],
file_search::FileSearchOptions {
#[expect(clippy::unwrap_used)]
limit: NonZero::new(FILE_SEARCH_LIMIT).unwrap(),
compute_indices: true,
..Default::default()
},

View File

@@ -6,6 +6,7 @@
//! on every keystroke, and drops the session when the query becomes empty.
use codex_file_search as file_search;
use std::num::NonZero;
use std::path::PathBuf;
use std::sync::Arc;
use std::sync::Mutex;
@@ -13,6 +14,8 @@ use std::sync::Mutex;
use crate::app_event::AppEvent;
use crate::app_event_sender::AppEventSender;
const FILE_SEARCH_LIMIT: usize = 100;
pub(crate) struct FileSearchManager {
state: Arc<Mutex<SearchState>>,
search_dir: PathBuf,
@@ -83,6 +86,8 @@ impl FileSearchManager {
let session = file_search::create_session(
vec![self.search_dir.clone()],
file_search::FileSearchOptions {
#[expect(clippy::unwrap_used)]
limit: NonZero::new(FILE_SEARCH_LIMIT).unwrap(),
compute_indices: true,
..Default::default()
},