Skip to content

ci: add CodSpeed Vitest benches for parse and HTML render - #388

Draft
farnabaz wants to merge 2 commits into
mainfrom
ci/codspeed-benchmarks
Draft

ci: add CodSpeed Vitest benches for parse and HTML render#388
farnabaz wants to merge 2 commits into
mainfrom
ci/codspeed-benchmarks

Conversation

@farnabaz

Copy link
Copy Markdown
Collaborator

What

Adds an isolated CodSpeed-compatible Vitest bench suite and a separate codspeed GitHub Actions workflow so parse/render performance can be tracked on main and PRs. Retires the invalid benchmark.test.ts that measured parseMarkdown against itself under a “markdown-it” label.

Why

Performance is a core Comark claim, and parser changes can introduce subtle regressions. The existing Mitata scripts are useful for local exploratory comparisons (including vs markdown-it/exit), but CodSpeed needs Vitest benches and stable, Comark-only workloads. Shipping a focused first suite (parse, autoClose off, incremental streaming, HTML render) in a lightweight workflow keeps signal high without bloating the main CI job. Reporting-only for now — no regression gate until variance is understood.

Notes for reviewers

  • Local: pnpm bench (wall-clock fallback when not on CodSpeed runners)
  • CI: .github/workflows/codspeed.yml runs CPU simulation on push/PR to main
  • Token: set CODSPEED_TOKEN after installing the CodSpeed GitHub app; without it the job still runs local simulation
  • Out of scope here: Shiki benches (init/async noise), markdown-it/exit baselines as gated comparisons, strict regression thresholds
  • Mitata scripts under benchmarks/*.ts are unchanged for ad-hoc local work

Introduce isolated Vitest benches and a separate CodSpeed workflow so
parser/render regressions can be tracked on main and PRs without mixing
into the heavy CI job. Remove the invalid dual-parseMarkdown "benchmark"
test and keep mitata scripts for local exploratory comparisons.
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
comark Ready Ready Preview Aug 26, 2026 4:00pm
comark-json-render Ready Ready Preview Aug 26, 2026 4:00pm
comark-nextjs Ready Ready Preview Aug 26, 2026 4:00pm
comark-nuxt Ready Ready Preview Aug 26, 2026 4:00pm
comark-svelte Ready Ready Preview Aug 26, 2026 4:00pm
comark-sveltekit Ready Ready Preview Aug 26, 2026 4:00pm
comark-twoslash Ready Ready Preview Aug 26, 2026 4:00pm
comark-vue Ready Ready Preview Aug 26, 2026 4:00pm

@pkg-pr-new

pkg-pr-new Bot commented Aug 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

comark

npm i https://pkg.pr.new/comark@388

@comark/angular

npm i https://pkg.pr.new/@comark/angular@388

@comark/ansi

npm i https://pkg.pr.new/@comark/ansi@388

@comark/html

npm i https://pkg.pr.new/@comark/html@388

@comark/nuxt

npm i https://pkg.pr.new/@comark/nuxt@388

@comark/react

npm i https://pkg.pr.new/@comark/react@388

@comark/svelte

npm i https://pkg.pr.new/@comark/svelte@388

@comark/vue

npm i https://pkg.pr.new/@comark/vue@388

commit: d7ce01a

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle size snapshot is out of date

The published size of one or more packages changed, so the inline snapshot in
test/bundle.test.ts no longer matches.

Please review the diff below. If the change is expected, accept the new snapshot:

  • 🔄 Update the bundle snapshot — tick this box and CI will run vitest run bundle --update and commit the result to this branch.

Update bundle snapshot

Only maintainers with write access can trigger the update. You can also comment /update-bundle-snapshot, or run it locally with pnpm prepack && pnpm vitest run bundle -u.

Bundle size diff
 FAIL  test/bundle.test.ts > package bundle size > published size of each package
Error: Snapshot `package bundle size > published size of each package 1` mismatched

- Expected
+ Received

@@ -4,7 +4,7 @@
    "@comark/html": "18.9k (58 files)",
    "@comark/nuxt": "11.8k (58 files)",
    "@comark/react": "43.6k (74 files)",
    "@comark/svelte": "43.9k (82 files)",
    "@comark/vue": "60.5k (78 files)",
-   "comark": "423k (156 files)",
+   "comark": "424k (156 files)",
  }

 ❯ test/bundle.test.ts:61:20
     59|     }
     60|
     61|     expect(report).toMatchInlineSnapshot(`
       |                    ^
     62|       {
     63|         "@comark/angular": "60.6k (70 files)",

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯

Full CI log

Add dedicated renderMarkdown and parse+renderMarkdown workloads so the
CodSpeed suite covers markdown roundtrip stringify, not only HTML.
@codspeed-hq

codspeed-hq Bot commented Aug 26, 2026

Copy link
Copy Markdown

Congrats! CodSpeed is installed 🎉

🆕 22 new benchmarks were detected.

You will start to see performance impacts in the reports once the benchmarks are run from your default branch.

Detected benchmarks


ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.


Open in CodSpeed

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