feat(bench): add benchmark infrastructure and optimization targets#569
Merged
wizzomafizzo merged 5 commits intomainfrom Mar 24, 2026
Merged
feat(bench): add benchmark infrastructure and optimization targets#569wizzomafizzo merged 5 commits intomainfrom
wizzomafizzo merged 5 commits intomainfrom
Conversation
Add comprehensive benchmarks across the critical path (slug search cache, fuzzy matching, slug generation, filename parsing, NDEF parsing, config, mappings, advargs). Add Taskfile tasks for bench workflow (bench, bench-db, bench-baseline, bench-compare). Add optimization target documentation and background agent prompts for security review, dependency audit, and optimization scanning. Add AGENTS.md sections for benchmarks and background agent mode.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…marks - Batch inserter benchmarks (insert, flush cost, commit cost) with real SQLite - Slug search cache build from real DB (10k, 50k titles) - Title resolution benchmarks (cache hit, exact match, fuzzy fallback) - Scan-to-launch pipeline benchmarks (exact match, direct path, with mapping) - Shared BuildBenchFilenames helper in pkg/testing/fixtures - Refactor NewInMemoryMediaDB to accept testing.TB for benchmark use - Remove stale fuzz commands for deleted zapscript/parser package - Fix bench tasks: add -run='^$', filter baseline output for benchstat
Add cross-compile + SSH pipeline for running benchmarks on real MiSTer hardware (Cortex-A9). Reduce benchmark sizes to fit MiSTer's 492MB RAM. Suppress zerolog output during benchmarks to prevent output corruption. Generate x86 and MiSTer baseline files.
Add Size() method to SlugSearchCache for deterministic memory measurement — replaces broken HeapAlloc delta that reported ~0 MB. Add runtime.KeepAlive to FlushScanStateMaps benchmark to prevent compiler dead-code elimination (was 78x too fast on x86). Update optimization targets with MiSTer multiplier bands, resolution cache optimization opportunity, and revised targets based on production measurements. Regenerate both baselines.
…rkflow Rewrite optimization-scan.md from generic 20-line prompt to full autoresearch-style experiment loop with keep/discard logic, MiSTer prediction via multiplier bands, and scope constraints. Add 4 target-specific prompts with exact file/function references, benchmark commands, x86 CI thresholds, and algorithmic ideas: - optimize-slug-search.md (#1: Search() linear scan, target 2.9ms x86) - optimize-fuzzy-matching.md (#2: worst-case full scan, target 2.9ms x86) - optimize-indexing.md (#3: pipeline 32s/10k, target 21s/10k on MiSTer) - optimize-memory.md (#4: 101MB RSS investigation, target 50MB)
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.
Summary
bench,bench-db,bench-baseline,bench-comparedocs/optimization-targets.md