Skip to content

Commit 5f6d1ae

Browse files
committed
docs: describe caching optimization statistics feature in README
1 parent 1365baf commit 5f6d1ae

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,33 @@ The logger supports the following log levels:
262262

263263
The logger is initialized during compilation when a valid `logPath` is provided.
264264

265+
## Local Optimization Config
266+
267+
`localOptimizationConfig` provides a workflow for caching optimization statistics
268+
locally so that `compile()` reads them from disk instead of fetching from the remote server.
269+
270+
### Directory layout
271+
272+
```text
273+
<configPath>/
274+
percent.json # lists which filters have stats (PERCENT_JSON)
275+
filters/
276+
<filterId>/
277+
stats.json # per-filter hit counts (STATS_JSON)
278+
```
279+
280+
### Workflow
281+
282+
1. Call `downloadPercentJson(configPath)` to download `percent.json` from the
283+
remote server and save it to `configPath`.
284+
2. Call `downloadStatsFromPercentJson(configPath, filterIds)` to download
285+
per-filter `stats.json` files listed in `percent.json`. An empty `filterIds`
286+
processes all filters; a non-empty array limits processing to specific filter IDs.
287+
3. Call `useLocalConfig(configPath)` before `compile()` to tell the compiler to
288+
read optimization stats from disk instead of the remote server.
289+
4. Call `reset(configPath)` when done to remove the cache directory and clear
290+
in-memory state.
291+
265292
## Additional resources
266293

267294
- [AGENTS.md](AGENTS.md) — AI agent instructions and code guidelines

0 commit comments

Comments
 (0)