Skip to content

perf(ui): cap initial file-tree fetch at depth 8 on dashboard#119

Merged
aksOps merged 1 commit into
mainfrom
perf/treemap-bounded-depth
May 4, 2026
Merged

perf(ui): cap initial file-tree fetch at depth 8 on dashboard#119
aksOps merged 1 commit into
mainfrom
perf/treemap-bounded-depth

Conversation

@aksOps
Copy link
Copy Markdown
Contributor

@aksOps aksOps commented May 4, 2026

Summary

`Dashboard.tsx` called `api.getFileTree()` with no depth argument, so
the backend returned the full tree (capped only by the 10 K `maxFiles`
limit). On a 200 K-node graph that's ~2-4 MB of JSON shipped to the
browser on every cold load, even though ECharts treemap only renders
one level at a time and drilling is client-side.

Cap the initial fetch at depth 8 — enough for a fully-qualified Java
path (`src/main/java/io/github////File.java` = 8
segments) and the typical TS/Python/Go layouts. Past depth 8 the
directory renders as a leaf with its aggregate node count; on-demand
subtree fetching for deeper drilling is a follow-up if real workloads
need it.

Test plan

  • `npm run build` — bundle builds cleanly (195.90 kB, 62.51 kB gzip)
  • Open dashboard against a real graph, verify treemap renders and drill-down works to depth 8
  • Confirm directories deeper than 8 show as leaves with cumulative counts (not blank)

🤖 Generated with Claude Code

Dashboard.tsx called `api.getFileTree()` with no depth, so the backend
returned the full tree (capped only by the 10 K maxFiles limit). On a
200 K-node graph that's ~2-4 MB of JSON shipped to the browser on every
cold load, even though ECharts treemap only renders one level at a time
and drilling is client-side.

Cap initial fetch at depth 8 — enough for a fully-qualified Java path
(`src/main/java/io/github/<org>/<pkg>/<sub>/File.java` = 8 segments) and
the typical TS/Python/Go layouts. Past depth 8 the directory renders as
a leaf with its aggregate node count; on-demand subtree fetching for
deeper drilling is a follow-up if real workloads need it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@aksOps aksOps enabled auto-merge (squash) May 4, 2026 17:14
@aksOps aksOps merged commit a2bb2e0 into main May 4, 2026
13 checks passed
@aksOps aksOps deleted the perf/treemap-bounded-depth branch May 4, 2026 17:16
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