pi vs pi-fff: measuring what the extension actually costs A paired benchmark of pi 0.99.2 with and without the @ff-labs/pi-fff 0.11.0 extension found the extension adds a paired median of 39.7 ms to CLI startup (slower in 23 of 25 interleaved rounds), 17 to 51 MB of extra RSS at session start, and 1,031 extra tokens on every model request, in exchange for grep running 6 to 33 times faster, find 12 to 16 times faster, and grep at $HOME 128 times faster. The author measured on CachyOS with an Intel Core Ultra X7 358H and an NVMe drive, using a fresh process per run in SDK mode with no LLM calls and PI_OFFLINE=1, reporting medians across runs. The per-request token cost is the figure that compounds, since it repeats on every request for the whole session, while the tool-call savings amount to a few milliseconds per call. pi vs pi-fff: measuring what the extension actually costs I have been running @ff-labs/pi-fff in pi for a while, mostly on the strength of the claim that fuzzy search over a pre-built in-process index beats spawning rg and fd on every tool call. That claim is easy to believe and easy to test, so I tested it. The setup: pi 0.99.2, @ff-labs/pi-fff 0.11.0, CachyOS on an Intel Core Ultra X7 358H with an NVMe drive. Fresh process per run, SDK mode with no LLM calls, PI OFFLINE=1 . Numbers are medians across runs. The two conditions differ only by the packages: "npm:@ff-labs/pi-fff" entry in ~/.pi/agent/settings.json . For the "without" side I stripped that line in memory for the SDK tests and rewrote then restored the file for the CLI test. Everything else, other extensions, settings, model config, stayed identical. Short version: with pi-fff, startup is about 40 ms slower paired median , session start costs 17 to 51 MB more RSS, and every model request carries 1,031 extra tokens. In exchange, grep runs 6 to 33 times faster, find 12 to 16 times faster, and grep at $HOME 128 times faster. Those ratios sound dramatic, but the absolute savings are a few milliseconds per call. The cost that actually matters is the token count, because it repeats on every request for the whole session. CLI startup pi --mode rpc spawn to ready: | condition | runs | min | median | mean | max | |---|---|---|---|---|---| | with | 25 | 217.8 | 266.4 | 258.2 | 291.8 | | without | 25 | 190.7 | 216.9 | 217.4 | 243.7 | Taken at face value, pi-fff adds 49.5 ms 22.8% to CLI startup. I also ran the conditions interleaved, one with and one without per round, so drift cancels out when the runs are paired: | paired with − without | n | median | Q1 | Q3 | rounds where with without | |---|---|---|---|---|---| | | 25 | 39.7 ms | 25.4 ms | 63.2 ms | 23/25 | The paired median of 39.7 ms is the number I trust, and with was slower in 23 of the 25 rounds. Session start, memory, and per-request payload A few phase names first. reload is resource and package discovery, which is where pi-fff gets resolved and loaded. create is session construction. bind is session start , which for pi-fff opens and builds the FFF file index for the current directory. rss is process memory right after startup, since the index lives in-process. payload is the system prompt plus the active tool schemas sent on every model request approx tokens = chars / 4 . | cwd | condition | runs | reload | create | startup | session start | rss after start | rss after tool runs | payload chars | ≈tokens | |---|---|---|---|---|---|---|---|---|---|---| | pi tree 4.7k files | with | 5 | 88.5 | 16.7 | 105.1 | 62.5 | 151 MB | 230 MB | 19302 | 4825 | | pi tree 4.7k files | without | 5 | 78.9 | 16.1 | 96.3 | 0.7 | 134 MB | 168 MB | 15178 | 3794 | | phoronix 11k files | with | 5 | 84.4 | 15.8 | 101.6 | 62.0 | 155 MB | 195 MB | 19285 | 4821 | | phoronix 11k files | without | 5 | 79.0 | 16.4 | 95.8 | 0.7 | 134 MB | 145 MB | 15161 | 3790 | | $HOME 1.2M files | with | 5 | 95.9 | 17.2 | 111.8 | 67.0 | 186 MB | 376 MB | 19253 | 4813 | | $HOME 1.2M files | without | 5 | 92.6 | 17.1 | 109.5 | 0.7 | 134 MB | 146 MB | 15129 | 3782 | | cwd | extra session start time | extra RSS | |---|---|---| | pi tree 4.7k files | +61.8 ms | +16.8 MB | | phoronix 11k files | +61.3 ms | +21.2 MB | | $HOME 1.2M files | +66.3 ms | +51.3 MB | The interesting line is the payload. pi-fff adds 4,124 characters, roughly 1,031 tokens, to every model request: 15,129 chars becomes 19,253 at $HOME . Two extra tool schemas, plus their guidelines in the system prompt. You pay that on the first request, the tenth, and the last one before you close the terminal. Tool-call latency Same session, same query, same result set. grep and find are pi's built-ins and spawn rg / fd per call; ffgrep and fffind are the pi-fff replacements that work over the pre-built index. cold is the first call of the run, median covers the rest. Only with runs are counted, because the fff tools do not exist otherwise. out is the character count of the returned result, included so you can see that both sides did comparable work. | cwd | query | tool | cold ms | warm median ms | result chars | errors | |---|---|---|---|---|---|---| | pi tree 4.7k files | find-fuzzy |