Create and lease native FFF indexes.
The process-wide pool owns the long-lived watched indexes. Scoped searches share the nearest authorized repository index, with one index per compatible ignore policy, overlay and content setting. An explicitly allowed non-Git root keeps its own watched index. Other scoped searches use a watcher-free snapshot at the exact scope and close it when the search ends.
Do not close a borrowed index. Call note-fs-write! after a filesystem
change so the next pooled search sees the write. A snapshot scans the
current files on each call.
Create and lease native FFF indexes. The process-wide pool owns the long-lived watched indexes. Scoped searches share the nearest authorized repository index, with one index per compatible ignore policy, overlay and content setting. An explicitly allowed non-Git root keeps its own watched index. Other scoped searches use a watcher-free snapshot at the exact scope and close it when the search ends. Do not close a borrowed index. Call `note-fs-write!` after a filesystem change so the next pooled search sees the write. A snapshot scans the current files on each call.
(covering-lease scope respect-ignore-files? overlay)Return the authorized repository lease and literal directory, if the overlay does not depend on the scope base.
Return the authorized repository lease and literal directory, if the overlay does not depend on the scope base.
(lease root respect-ignore-files?)(lease root respect-ignore-files? overlay)(lease root respect-ignore-files? overlay {:keys [content-indexing? resync?]})One pool key: which root, under which ignore policy, with which ignore
overlay. Bundled into a single value so with-index keeps a plain
[binding init] shape. Files under root that this process holds OS locks
on (paths/held-file?) join the overlay's exclude globs, so no index opens
them.
opts takes two flags, both true by default:
:content-indexing? false builds a path-only index (see open!).:resync? false skips the read-your-writes rescan. Use it for a caller on a
critical path that can read the watcher-live index.One pool key: which root, under which ignore policy, with which ignore overlay. Bundled into a single value so `with-index` keeps a plain `[binding init]` shape. Files under `root` that this process holds OS locks on (`paths/held-file?`) join the overlay's exclude globs, so no index opens them. `opts` takes two flags, both true by default: - `:content-indexing?` false builds a path-only index (see `open!`). - `:resync?` false skips the read-your-writes rescan. Use it for a caller on a critical path that can read the watcher-live index.
Largest file whose CONTENT an index will read, in bytes (256 MiB).
fff's own default is 10 MB (MAX_FFFILE_SIZE), and everything above it was
skipped SILENTLY: a needle sitting in a 20 MB log, dump or generated source
made grep answer "No file NAME or CONTENT matched". A silent false
negative is strictly worse than the slow scan this discovery path replaced,
so the budget is raised HERE and at the fff/grep call site — the index's
own content budget wins, so moving only one of the two still reads nothing.
Cost is page cache, not heap: fff reads these files itself, and vis streams
them line by line (search-file-content) rather than slurping them.
Largest file whose CONTENT an index will read, in bytes (256 MiB). fff's own default is 10 MB (`MAX_FFFILE_SIZE`), and everything above it was skipped SILENTLY: a needle sitting in a 20 MB log, dump or generated source made `grep` answer "No file NAME or CONTENT matched". A silent false negative is strictly worse than the slow scan this discovery path replaced, so the budget is raised HERE and at the `fff/grep` call site — the index's own content budget wins, so moving only one of the two still reads nothing. Cost is page cache, not heap: fff reads these files itself, and vis streams them line by line (`search-file-content`) rather than slurping them.
(note-fs-write! path)Record a write for each pooled tree that it changes. The next search refreshes only the written path, so it reads its own write without a rescan.
Record a write for each pooled tree that it changes. The next search refreshes only the written path, so it reads its own write without a rescan. - A tree that contains the path refreshes that path. fff rescans the tree itself when the path is an ignore file. - An ignore file in a directory above a tree changes the rules of that tree, so the tree rescans. - Other trees keep their read-your-writes epoch.
(pool-stats)Process-wide lifecycle totals and current leases, without forcing a cold index.
Counters distinguish initial scans, reuse, invalidation and eviction reasons;
structured ::lifecycle logs carry per-root scan duration and index identity.
Process-wide lifecycle totals and current leases, without forcing a cold index. Counters distinguish initial scans, reuse, invalidation and eviction reasons; structured `::lifecycle` logs carry per-root scan duration and index identity.
(prewarm! lease)Build this lease's index OFF the calling thread, at most one build in flight
per key (the pool's delay guarantees that). Returns nil immediately; poll
warm? to find out when searching became cheap.
Build this lease's index OFF the calling thread, at most one build in flight per key (the pool's `delay` guarantees that). Returns nil immediately; poll `warm?` to find out when searching became cheap.
(scope-relative-item directory item)Rebase an item returned by a scoped native query to that scope.
Rebase an item returned by a scoped native query to that scope.
(warm? lease)True when this lease's index is ALREADY built — i.e. with-index on it will
only pay for a search, never for a tree scan. Lets a latency-sensitive caller
(the TUI @ popup on the render thread) skip the first, blocking build.
True when this lease's index is ALREADY built — i.e. `with-index` on it will only pay for a search, never for a tree scan. Lets a latency-sensitive caller (the TUI `@` popup on the render thread) skip the first, blocking build.
(with-index [sym lease] & body)(with-index [idx (lease root respect?)] body…) — body runs with a
POOLED, watcher-live fff index, resynced before use. Do NOT close idx: the
pool owns it and retires it on idle/LRU eviction.
`(with-index [idx (lease root respect?)] body…)` — body runs with a POOLED, watcher-live fff index, resynced before use. Do NOT close `idx`: the pool owns it and retires it on idle/LRU eviction.
(with-index* lease f)Call f with the process-wide index shared by every worker for this root and
ignore policy. Borrowed indexes remain in the pool under capacity pressure.
Call `f` with the process-wide index shared by every worker for this root and ignore policy. Borrowed indexes remain in the pool under capacity pressure.
(with-scoped-index* scope respect-ignore-files? overlay f)Call f with an index, its base and an optional literal scope. A repository
root and an allowed root keep their watched index. Any other scope that no
watched index covers is scanned once without a watcher. When that scan was
slow, the next search of the scope gets a watched index, because only a
retained index has a content index.
Call `f` with an index, its base and an optional literal scope. A repository root and an allowed root keep their watched index. Any other scope that no watched index covers is scanned once without a watcher. When that scan was slow, the next search of the scope gets a watched index, because only a retained index has a content index.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |