Problem
In Conda::find, each spawned per-env worker reads the env's conda-meta/history file at least twice:
- In
get_conda_installation_used_to_create_conda_env (crates/pet-conda/src/environments.rs) to recover the conda install dir from the # cmd: line.
- In
CondaPackageInfo::from(env_path, Package::Python) (crates/pet-conda/src/package.rs) to recover the Python version from the +...:python-... line.
For installs with several envs and non-trivial history files, this is a meaningful amount of redundant sync I/O on every refresh — disproportionate on Windows where each file open is more expensive under default Defender real-time scan.
Proposal
In-flight memoization within a single find() call. Pass a shared map (e.g. Arc<DashMap<PathBuf, String>>) into the spawn loop so the second read of the same history file in the same refresh is free. No change to external behavior.
This is intentionally smaller and lower-risk than the broader caching question (clear-on-find / mtime-keyed cache), which I'll file separately.
Problem
In
Conda::find, each spawned per-env worker reads the env'sconda-meta/historyfile at least twice:get_conda_installation_used_to_create_conda_env(crates/pet-conda/src/environments.rs) to recover the conda install dir from the# cmd:line.CondaPackageInfo::from(env_path, Package::Python)(crates/pet-conda/src/package.rs) to recover the Python version from the+...:python-...line.For installs with several envs and non-trivial history files, this is a meaningful amount of redundant sync I/O on every refresh — disproportionate on Windows where each file open is more expensive under default Defender real-time scan.
Proposal
In-flight memoization within a single
find()call. Pass a shared map (e.g.Arc<DashMap<PathBuf, String>>) into the spawn loop so the second read of the same history file in the same refresh is free. No change to external behavior.This is intentionally smaller and lower-risk than the broader caching question (clear-on-find / mtime-keyed cache), which I'll file separately.