perf: inherit editorial on filtered variants (drops 75% Prom load per page) - #188
Merged
Merged
Conversation
…ting PR #182 made every filtered variant run the per-chain Prom fan-out so {{best_name:chain:X}} could resolve in the variant's findings/faq/seoIntro. That quadrupled cold-cache Prom load per page (3 extra queries × 9 pre-fetched variants on benches like aggregator-head-lag), making cold-start visibly sluggish on Vercel preview URLs and pushing some bench loads close to the function timeout. Cleaner: editorial copy is the same on every tab (it's the same YAML), so filtered variants don't need their own per-chain compute. They inherit findings / faq / seoIntro / abstract / methodology / perChainExplainer / bestPerChain / worstPerChain from the aggregate at the page-level fetch. Per-chain compute stays on the unfiltered hub only. Net effect: page cold-start drops from 36 query sets to 9, while keeping all the chain-aware placeholders correctly resolved on every tab.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Likely cause of the 'almost always draft on staging' navigation perception. PR #182 made every filtered variant run per-chain Prom fan-out (3 extra queries each) so chain-aware placeholders could resolve. With 9 pre-fetched variants per bench, that quadrupled the cold-cache Prom load.
Editorial copy (findings, faq, seoIntro, etc.) is the SAME on every tab — only chart data legitimately differs by filter. So filtered variants don't need their own per-chain compute. They inherit editorial + per-chain stash from the aggregate at the page level instead.
!isFilteredguard on the per-chain block. Filtered variants don't do the extra Prom queries anymore.Net: page cold-start drops from 36 query sets to 9 on a 3-chain bench, while chain-aware placeholders stay resolved on every tab.