I had a faster index refresh. The tempting headline was that I had made search faster. Before I could say that, I had to measure what someone actually waits for when they issue a query.
Refreshing an index and retrieving a result are different operations. An index refresh reads and prepares material so later queries can find it. A query uses that preparation to locate a note. In a tool where the user runs refresh at startup, the first operation can dominate what they feel. In a tool that already has a fresh index, it can disappear from their experience altogether. Calling either one “search latency” would leave the reader to guess what the timer included.
I compared two builds on one Apple Silicon Mac using a corpus of 480 invented notes. Each retrieval test had a known expected note. I timed the refresh and three kinds of retrieval separately. The refresh moved by more than a second. The rest of the results were smaller and gave me a better idea of which conclusions I could carry beyond the test.
Thesis: A performance result is useful when it names the operation somebody waits for and tests the claim at that boundary.
Why now: An index refresh can improve dramatically without a comparable change in the requests it serves.
Who should care: Engineers reporting performance work and product teams deciding which wait to shorten.
Bottom line: Time refresh and retrieval separately, check result correctness, and keep the strength of the claim proportional to the runs.
Set one timing boundary for each question
I ran paired builds on the same machine with the same synthetic corpus. For each build, I made three batches of nine measured runs after two warmup iterations per batch. The timed work excluded CLI startup. I pooled the measured runs for the figures below and checked that exact, keyword, and hybrid retrieval returned the expected note in the fixture.
Exact retrieval looked up a known record. The keyword path used text matching, and the hybrid path combined retrieval signals. Keeping those cases separate was important. An improvement in one path could disappear in an aggregate, and a change in one path supplies little evidence about another. Warmup was part of the test protocol because startup and warmed runs describe different states. The pyperf benchmark guidance provides a useful reference for treating warmup and measured observations separately.
| Operation | Before | After |
|---|---|---|
| Index refresh | 1.090 s | 0.0092 s |
| Exact lookup | 1.03 ms | 1.06 ms |
| Keyword retrieval | 0.92 ms | 1.01 ms |
| Hybrid retrieval | 7.55 ms | 6.18 ms |
The pooled refresh median went from 1.090 seconds to 9.2 milliseconds, about a 118-fold improvement for the operation I timed. Exact and keyword retrieval were close across the two builds. Hybrid retrieval had a lower pooled median, and the batch medians overlapped. I’d report the direction as an observation for this fixture. I’d need a larger and more varied experiment to claim a reliable hybrid improvement.
Keep the result check inside the experiment design
A timer can reward a broken program. A shortcut that skips loading some notes or returns the first plausible candidate can look excellent if I only count elapsed time. For this experiment, all three retrieval paths still had to give back the expected note. That checked a specific property of the fixture, while leaving broader ranking quality and recall open.
The synthetic corpus also limits what the numbers can tell me. It was small, fixed, and run on one machine. CLI startup was outside the measurement. The test doesn’t estimate end-to-end latency on other machines or behavior when refresh and retrieval compete for resources. It gives me a clean comparison for the measured paths and a place to start changing the size, shape, and environment of the workload.
When the question is about the slow requests, I’d keep the timing distribution and inspect the relevant percentiles. A median is a useful statement about a typical observation. Users hit the rest of the distribution too. Google’s SRE guidance on service-level objectives describes why averages can hide the experience at the tail.
Change the test when the product question changes
If someone opens the CLI and waits for the first answer, I’d start the clock before launch and stop when the result is available. If a new note should become visible after a sync, I’d measure from completion of the write to the first correct retrieval. If a hybrid lookup has a long tail when several people query at once, I’d build that workload explicitly and report enough observations to characterize it.
Those experiments can share fixtures and instrumentation, while each still has an observable stopping point. I’d start by writing that stopping point in a sentence. It keeps a large improvement in the wrong operation from becoming the answer to an unrelated product question.
What transfers
The headline I can support is that refresh got much faster in this experiment. Query results were steadier, and the hybrid observation warrants another test if it bears on a real wait. Separating those claims made each one easier to evaluate and gave me a better way to decide what to measure next.
For another example of how one benchmark can hide the performance of the thing a user came to do, see The Model Is Not the Unit of AI Performance.
