Sitelet https://github.com/GoogleCloudPlatform/evalbench/pull/555
Skip to content

perf(viewer): share one mtime-keyed cache for the trends CSV and dir listing - #555

Open
omkargaikwad23 wants to merge 1 commit into
perf/list-summaries-cachefrom
perf/shared-trends-caches
Open

omkargaikwad23 wants to merge 1 commit into
perf/list-summaries-cachefrom
perf/shared-trends-caches

Conversation

@omkargaikwad23

@omkargaikwad23 omkargaikwad23 commented Aug 9, 2026 •

Copy link
Copy Markdown
Collaborator

trends_cache.csv was reparsed on every render by the Status tab, the Charts tab and the List view. On the GCS FUSE mount each parse reads the full file, so the cost scaled with the number of runs and ran on interactions that needed no data.

Add load_trends_df, keyed on the file mtime, and route the Status tab, the Charts tab and load_summaries through it. The CSV is parsed once per change rather than once per render.

load_trends_df reads with usecols=lambda c: c != 'ai_summary' and applies precompute_trends.filter_valid_cache_rows, the same as the readers it replaces. The run detail view keeps its own narrow read because it needs ai_summary for one run.

The frame is shared, so the Charts filter chain uses assign() rather than an in-place column write.

Rebased on main 2026-11-10. The original list_run_dirs is dropped: main now has run_index.list_run_directories, which caches the directory listing with a TTL and an explicit invalidate().


Stack created with GitHub Stacks CLI • Give Feedback 💬

Comment thread viewer/main.py Fixed
Comment thread viewer/main.py Fixed
Comment thread viewer/main.py
return None

logging.info(f"Loaded {len(df)} rows from trends cache.")
_TRENDS_DF_CACHE = (mtime, df)
@omkargaikwad23
omkargaikwad23 force-pushed the perf/shared-trends-caches branch from aeac5e4 to 8c9122e Compare November 11, 2026 05:46
@omkargaikwad23
omkargaikwad23 removed this pull request from stack #562 November 11, 2026 05:46
@omkargaikwad23
omkargaikwad23 changed the base branch from perf/chart-payload to perf/list-summaries-cache November 11, 2026 05:46
…listing

trends_cache.csv was reparsed on every render by the Status tab, the
Charts tab and the run detail view, and the results directory was
relisted three times per page load. On the GCS FUSE mount each listing
costs one stat per run directory, so both scaled with the number of runs
and ran on interactions that needed neither.

Add load_trends_df and list_run_dirs, keyed on mtime, and route every
caller through them. load_summaries now builds on load_trends_df so the
CSV is parsed once rather than twice.

The frame is now shared, so the Charts filter chain uses assign() rather
than an in-place column write, which would otherwise have welded
product_dataset onto the cached object.
@omkargaikwad23
omkargaikwad23 force-pushed the perf/shared-trends-caches branch from 8c9122e to d0edc26 Compare November 11, 2026 05:54
@omkargaikwad23
omkargaikwad23 force-pushed the perf/list-summaries-cache branch from efa7bde to a880916 Compare November 11, 2026 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant