Add CodSpeed continuous performance benchmarks - #389
Open
codspeed-hq[bot] wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
comark
@comark/angular
@comark/ansi
@comark/html
@comark/nuxt
@comark/react
@comark/svelte
@comark/vue
commit: |
Author
Congrats! CodSpeed is installed 🎉
You will start to see performance impacts in the reports once the benchmarks are run from your default branch.
|
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.
This adds continuous performance measurement to the repository with CodSpeed, so parser and renderer regressions show up on every pull request.
What was added
Benchmark suite (
benchmarks/*.bench.ts, Vitest bench)The suite focuses on comark's own hot paths rather than comparisons with other parsers (the existing
mitatascripts inbenchmarks/are left untouched and remain the place for cross-library comparisons). 28 benchmarks in total:parse.bench.ts— parsing small, medium and large documents, plus the effect ofautoClose: false,registerDefaultPlugins: false, and creating a fresh parser per call.render.bench.ts—renderHtmlFromDocument,renderAnsiFromDocumentandrenderMarkdownon pre-parsed documents, plus one combined parse + render pass.streaming.bench.ts—autoCloseMarkdownon partial and complete documents, streaming-mode parsing, and re-parsing a full sequence of growing chunks (the LLM streaming path).plugins.bench.ts— per-plugin cost fortoc,emoji,punctuation,footnotes,securityandsummary, individually and combined, against a baseline.Fixtures live in
benchmarks/fixtures.tsand are deterministic so results stay comparable across runs.Tooling
@codspeed/vitest-pluginadded as a root dev dependency (through the catalog) and wired intovitest.config.ts. The plugin is a no-op outside of a CodSpeed run, so localvitest benchand the existingtest/suite are unaffected.benchmark.includescoped tobenchmarks/**/*.bench.ts, matching howtest.includeis already scoped.pnpm benchscript..github/workflows/codspeed.ymlruns the benchmarks onmain, on pull requests and onworkflow_dispatch, usingCodSpeedHQ/action@v5insimulationmode with OIDC authentication. The Node/pnpm setup mirrorsci.yml.Dependency notes
@codspeed/vitest-pluginhas not widened itsvitepeer range to v8 yet. Without a workaround pnpm resolves the root workspace back to vite 7, which would silently downgrade vitest and nuxt at the root. ApackageExtensionsentry inpnpm-workspace.yamlwidens that peer range, andviteis now an explicit root dev dependency pinned to the catalog version (^8.1.4) so the resolution stays on vite 8.@codspeed/corepulls inaxios, which changes a number of hashed peer-resolution keys. No package versions are downgraded.Verification
Run locally with the CodSpeed CLI in simulation mode (
codspeed run --mode simulation -- pnpm bench): all 28 benchmarks were collected and reported successfully.pnpm lintandpnpm typecheckpass.Next steps
main; the first pull requests afterwards will get performance reports.workflow_dispatch) to backfill historical data.