Skip to content

v1.3.174

Choose a tag to compare

@topcheer topcheer released this 23 Jul 02:39

ggcode v1.3.174

Highlights

  • ggcode report 6.6x faster: Parallel file scanning + lightweight JSONL line filtering reduces session analytics from 23s to 3.5s on 2.8GB of data.
  • Improved diagnostics: Disk write failures for usage/metrics, hooks config, and tunnel start are now logged instead of silently discarded.

Performance

ggcode report Scanner Optimization

Two-stage optimization of the session analytics scanner:

  1. fastType line filtering (912b56f0): Before full JSON unmarshal, scan the first 100 characters of each line to extract the "type" field. Only meta, usage, metric, and message types need processing — the other ~90% of lines (reasoning, tool_result, tool_use, text, tunnel_event) are skipped with a lightweight string scan.

  2. Parallel file scanning (07842e12): Each JSONL file is scanned in a separate goroutine instead of sequentially. Files are fully independent (no shared state), making this embarrassingly parallel.

Benchmark on 68 sessions (2.8GB JSONL, 4.2M lines):

Stage Duration Speedup
Original 23.1s
+ fastType 9.7s 2.4x
+ parallel scan 3.5s 6.6x

Throughput: 811 MB/s read+scan rate (approaching NVMe hardware limit).

Fixes

Disk Write Error Logging

Three error paths that previously discarded errors with _ = are now logged via debug.Log:

  • Usage/metric persistence (346d0300): AppendUsageEntry and AppendMetric errors in recordSessionUsage/recordSessionMetric were silently discarded. If the disk write fails (disk full, permissions), token usage and metric data were silently lost with no diagnostic. The adjacent AppendMetaToDisk call already logged its errors — these two were an oversight.

  • Hooks config save (bb9b0c30): saveHooksConfig discarded the config.Save() error. If the disk write fails, hooks config silently reverts on restart with no diagnostic.

  • Tunnel start failure (af496e05): Tunnel start errors were only shown in the chat UI (ephemeral) with no debug.Log. When users report tunnel connection issues, developers had no way to see the failure reason from debug logs. Added debug.Log with generation number for correlation.

Upgrade Notes

No breaking changes. All improvements are backward compatible.

Compare

v1.3.173...v1.3.174