bench: document optimization trials and cover initial history restore - #31
Conversation
✅ Deploy Preview for markdown-it-ts ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fab06d3706
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| workloads.push({ name: `options-restore-${name}`, messages: Array.from({ length: 60 }, (_, i) => unit(i).repeat(15)), options }) | ||
| } | ||
| for (const size of [100_000, 1_000_000]) { | ||
| workloads.push({ name: `history-restore-${size}`, messages: [prose(0).repeat(Math.ceil(size / prose(0).length))] }) |
There was a problem hiding this comment.
Use a fresh parser for first-restore workloads
When --warmups is nonzero (the documented runs use 2 or 50), each new one-message workload resolves the same getMarkdown('history-0') key already used by earlier restore workloads and warmup passes. Because getMarkdown caches by key, the measured pass reuses warmed parser/linkify state and excludes parser creation, so these cases do not measure the claimed initial large-history restore. Use a unique key per workload/run or clear the parser cache before timing.
Useful? React with 👍 / 👎.
Deploying markdown-it-ts with
|
| Latest commit: |
de04068
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e724ec89.markdown-it-ts.pages.dev |
| Branch Preview URL: | https://codex-markstream-linkify-cpu.markdown-it-ts.pages.dev |
The existing consumer benchmark measures appends after loading a large history, but does not separately measure the initial parse of one large history document. Add 100k/1m first-restore cases and record the completed streaming/CPU investigation, including reproducible final measurements and rejected experiments.
The only retained runtime optimization is in markstream-vue #753. This PR changes the benchmark and evidence only. All experimental markdown-it-ts production changes were reverted because they lacked stable independent consumer benefit or failed compatibility checks. Both final benchmark variants use byte-identical parser builds.
The report includes:
Validation: slow streaming suite enabled (61 files / 1,187 tests passed; 9 skipped), lint, typecheck, test:types, build, benchmark syntax, JSON medians/hash validation and
git diff --check. Consumer validation: 3,088 tests, lint/typechecks/build, main playground smoke and rich-content scroll assertions on a bounded diagnostic rerun.CI fix: regenerated the native performance snapshot with
pnpm run perf:all:latestand updated both README metric blocks.perf:methodology:checkandperf:update-readme:checknow pass locally. The original snapshot fingerprint was already stale at the base commit; it has been replaced with an actual fresh measurement, not a manually changed fingerprint. This remains a benchmark/evidence PR with no parser runtime changes.Consumer CI follow-up: the initial screen caused a repeatable peak-frame regression by deferring regex initialization. Markstream
447940331preserves native cold streaming initialization timing, and its online performance job now passes without changing thresholds.docs/perf-stream-history-ci-followup.md/jsoncontains the diagnosis, original CI artifacts, six local CI benchmark scenarios and a fresh 61-case matrix. The earlier report is explicitly labeled as the initial candidate.