File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -262,6 +262,33 @@ The logger supports the following log levels:
262262
263263The 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
You can’t perform that action at this time.
0 commit comments