Async Mermaid/Liquid rendering with sync-vs-async benchmarks - #6
Merged
Conversation
Collect independent Mermaid and Liquid fences during Markdown parsing and render them with Tokio spawn_blocking so CPU-bound work can overlap across cores. Add a heavy fixture and sync-vs-async benchmark results. Co-authored-by: Thomas <0xtlt@users.noreply.github.com>
Replace string placeholders with structured body segments so user content cannot collide with job markers, cap the Tokio blocking pool to available CPUs, reuse one Liquid highlighter on the sync path, and add regression tests for marker text and mixed Mermaid/Liquid ordering. Co-authored-by: Thomas <0xtlt@users.noreply.github.com>
Stop tracking benches/results snapshots so local timing runs stay out of git; keep the fixture, harness, and README summary. Co-authored-by: Thomas <0xtlt@users.noreply.github.com>
Add benches/results/ to .gitignore and point the benchmark README at locally generated timing files. Co-authored-by: Thomas <0xtlt@users.noreply.github.com>
0xtlt
marked this pull request as ready for review
July 29, 2026 14:24
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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
spawn_blockingon a shared, CPU-capped runtime (max_blocking_threads= 2–8).benches/results/*.jsonis gitignored.Review fixes
BodySegment::{Text,Job}spawn_blocking→ capped blocking pool on a process-wide runtimebenches/results/Benchmark (4× Xeon @ 2400 MHz, 2 warmups + 7 runs)
Fixture:
benches/fixtures/heavy-async.md(48 Mermaid + 24 Liquid + 8 Rust). Summary lives inbenches/README.md.Hardware PMU cycles unavailable (
perf_event_openEACCES); cycles estimated as(user+sys) * 2400MHz.