Skip to content

perf(gen_build): cache ns declarations, fix #?@ reader conditional handling#93

Open
english wants to merge 1 commit into
griffinbank:mainfrom
english:series/gen-srcs-ns-decl-cache
Open

perf(gen_build): cache ns declarations, fix #?@ reader conditional handling#93
english wants to merge 1 commit into
griffinbank:mainfrom
english:series/gen-srcs-ns-decl-cache

Conversation

@english
Copy link
Copy Markdown
Contributor

@english english commented Apr 4, 2026

Scans source directories once via build-src-index (using tools.reader) and caches ns declarations
for reuse in ns-rules. This eliminates double file reads during discovery and rule generation.

Also fixes a latent bug where get-ns-decl (using clojure.core/read) silently dropped
platform-specific requires inside #?@ splicing reader conditionals in .cljc files.
Since the cache now covers all source files, the buggy
get-ns-decl fallback is removed entirely.

Benchmark

examples/gen_srcs_bench (Hyperfine, 5 runs, 19607 namespaces, prepare: delete src/**/BUILD.bazel)

  • before: 11.582s ± 2.305s
  • after: 9.462s ± 1.048s
  • change: -18.3%

(written by Claude)

@english english force-pushed the series/gen-srcs-ns-decl-cache branch from 4c0e5cc to c0a4046 Compare April 4, 2026 20:11
…ndling

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@english english force-pushed the series/gen-srcs-ns-decl-cache branch from c0a4046 to c709ed0 Compare April 4, 2026 20:44
@english english marked this pull request as ready for review April 4, 2026 20:45
@english english requested a review from a team April 4, 2026 20:45
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