Skip to content

Load local analytics only when needed - #37

Merged
thrr87 merged 2 commits into
codex/reduce-refresh-costfrom
codex/lazy-local-analytics
Jul 30, 2026
Merged

Load local analytics only when needed#37
thrr87 merged 2 commits into
codex/reduce-refresh-costfrom
codex/lazy-local-analytics

Conversation

@thrr87

@thrr87 thrr87 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

What

  • Keep the default Usage remaining view on account data only.
  • Load local Codex records only when a local graph, Facts, or Insights needs them.
  • Save new local facts and release the in-memory cache when the user leaves those views.
  • Keep automatic refreshes from restarting a local import.
  • Reduce the Usage remaining chart height from 300 to 240 points.

Why

A real 400 MB Codex history can produce more than 400,000 local facts. The
default view did not need them, but opening the app still loaded them into
memory.

This is the first part of #36. It removes that work from the common path.
The next stacked change will replace the remaining full in-memory local
history with bounded SQLite queries.

Measured on the real profile

  • Clean QA launch on Usage remaining: about 102–103 MB RSS.
  • Manual account refresh on that view: about 103 MB RSS.
  • Local Facts still reaches about 160–175 MB and needs the SQLite step.

Checks

  • 500 Swift tests pass.
  • Added race tests for hiding a local view during a suspended read.
  • Verified Graphs, Facts, and Insights with the full-screen QA app.
  • The shorter chart keeps all Usage remaining controls and facts visible
    without a scroll.

Stacked on #33.

* perf: use account data for lightweight analytics core

* chore: prepare v0.2.4

---------

Co-authored-by: thrr87 <193831865+thrr87@users.noreply.github.com>
@thrr87
thrr87 merged commit 83791ca into codex/reduce-refresh-cost Jul 30, 2026
1 check passed
@thrr87
thrr87 deleted the codex/lazy-local-analytics branch July 30, 2026 19:50
thrr87 added a commit that referenced this pull request Jul 30, 2026
* perf: reuse timestamp parser during activity restore

* fix: bound usage chart and harden Codex reads (#34)

Co-authored-by: thrr87 <193831865+thrr87@users.noreply.github.com>

* perf: reuse timestamp parser during activity restore

* perf: bound refresh memory and local ingestion

* Load local analytics only when needed (#37)

* perf: load local analytics on demand

* Use App Server account data for the lightweight core (#42)

* perf: use account data for lightweight analytics core

* chore: prepare v0.2.4

---------

Co-authored-by: thrr87 <193831865+thrr87@users.noreply.github.com>

---------

Co-authored-by: thrr87 <193831865+thrr87@users.noreply.github.com>

---------

Co-authored-by: thrr87 <193831865+thrr87@users.noreply.github.com>
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