Repository navigation
ghusage 0.1.3
Faster reports from the cache
Reports over a period (overview, daily, prs, the terminal UI, ...) load much faster from a large cache. The output is unchanged.
- Earlier history only where it is used. For lifetime timings such as time to first review, a period load also reads events from before the period. It did this for every pull request active in the period. Timings are computed only for your own pull requests, so the earlier history is now read only for those.
- Cheaper row decoding. Reading a cached event looked up each of its columns by name on every row, and profiles showed this lookup dominating large loads. Column positions are now resolved once per query.
Benchmark with 100,000 cached events (release build, p95):
| 0.1.2 | 0.1.3 | Target | |
|---|---|---|---|
| Cached 7-day aggregation (load + overview), CI runner (x64) | 643 ms | 145 ms | ≤ 200 ms |
| Cached 30-day aggregation (load + overview), CI runner (x64) | 806 ms | 223 ms | ≤ 500 ms |
| Cached 7-day aggregation, Apple Silicon | — | 94 ms | ≤ 200 ms |
| Cached 30-day aggregation, Apple Silicon | — | 126 ms | ≤ 500 ms |
The CI rows compare both versions on the same runner. The Apple Silicon rows were measured locally (50 runs after 5 warm-up runs).
Documentation
- Known limitations: waiting for an exhausted primary rate limit has been checked against the real GitHub API by using up the search limit. Secondary rate limits are still covered only by tests that simulate GitHub's responses.
Install / update
npm install -g ghusage@0.1.3Full changelog: v0.1.2...v0.1.3