Problem
Every build compiles the registry twice.
astro.config.mjs calls buildNoindexPredicate() while Astro loads the config. Astro loads the config in a module graph that is separate from the page modules, so the cached memo in src/lib/registry.ts is not shared. compileRegistry therefore runs once for the config and once for the pages.
Instrumenting compileRegistry and running npx astro build prints the marker twice.
Why it matters
One compileRegistry() call on the real data takes about 2.65 s and materialises 86,397 records. The duplicate pass adds that time and a second in-memory copy to every build and to every astro dev start.
Suggested fix
Build the predicate lazily inside the sitemap filter callback, or share one compiled registry between the config and the pages.
Found during review of #127. Not caused by that PR.
Problem
Every build compiles the registry twice.
astro.config.mjscallsbuildNoindexPredicate()while Astro loads the config. Astro loads the config in a module graph that is separate from the page modules, so thecachedmemo insrc/lib/registry.tsis not shared.compileRegistrytherefore runs once for the config and once for the pages.Instrumenting
compileRegistryand runningnpx astro buildprints the marker twice.Why it matters
One
compileRegistry()call on the real data takes about 2.65 s and materialises 86,397 records. The duplicate pass adds that time and a second in-memory copy to every build and to everyastro devstart.Suggested fix
Build the predicate lazily inside the sitemap
filtercallback, or share one compiled registry between the config and the pages.Found during review of #127. Not caused by that PR.