Skip to content

perf: optimize startup, search and HTTP navigation - #937

Merged
antonreshetov merged 34 commits into
mainfrom
feat/performance-benchmarks
Sep 16, 2026
Merged

antonreshetov merged 34 commits into
mainfrom
feat/performance-benchmarks

Conversation

@antonreshetov

Copy link
Copy Markdown
Member

Summary

Improve startup, search, memory use, and HTTP navigation for large libraries:

  • Tokenize repeated words and lines once, avoid redundant fragment parsing and retained copies of search text, and update indexes incrementally after content edits.
  • Prepare search indexes and vault checks in batches so other actions can proceed; skip unnecessary legacy Notes asset scans at startup.
  • Virtualize HTTP navigation and eliminate repeated tree allocations and per-node document scans.
  • Add isolated benchmark vaults, measurement tools, and a shared HTTP development server; remove the superseded demo servers.
  • Allow the perf conventional commit type.

Measurements

Internal synthetic-library tests on an Apple M4 Pro with approximately 30,000 records:

Scenario Before After
Startup into Code 4.33 s 1.83 s
Startup into Notes 4.44 s 1.91 s
Startup into HTTP 4.86 s 2.15 s
First Code search, 10,000 snippets 13.79 s 1.95 s
First Notes search, 10,000 notes 4.42 s 0.88 s
Exact HTTP sidebar filtering, 10,000 requests 22–24 s 7–13 ms
Retained JavaScript memory after Code and Notes searches 1,036 MiB 560 MiB

Startup results use 36 alternating original/current build launches across two library sizes and three spaces, with identical profile/vault copies and a warmed filesystem cache. Search and filtering compare historical sessions; memory uses a focused before/after experiment. Search measures API processing, filtering measures list updates, and startup ends at the selected item's open event. These are not input-to-screen measurements. Results vary with content and hardware.

Validation

  • 218 scoped tests passed during review, plus two regression tests for HTTP benchmark readiness. Both regression tests fail on the previous implementation and pass after the fix.
  • Scoped ESLint, main TypeScript and production renderer builds passed; diff checks are clean.
  • Completed 36 startup measurements and six HTTP runtime remeasurements after correcting the readiness gate.
  • Reviewed storage/search/API and renderer/Electron/benchmark changes. The additional HTTP benchmark readiness finding is fixed.

Separate follow-up

The known drag-source lifecycle and scroll-preservation fixes remain in fix/tree-drag-scroll and are intentionally excluded from this PR. Benchmark reports and release drafts are local, gitignored artifacts.

@antonreshetov antonreshetov self-assigned this Sep 16, 2026
@antonreshetov
antonreshetov merged commit 9bfc3a4 into main Sep 16, 2026
@antonreshetov
antonreshetov deleted the feat/performance-benchmarks branch September 16, 2026 16:25
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