Skip to content

Use production syntax highlighting grammars - #1

Merged
0xtlt merged 3 commits into
mainfrom
agent/optimize-3-1
Jul 28, 2026
Merged

Use production syntax highlighting grammars#1
0xtlt merged 3 commits into
mainfrom
agent/optimize-3-1

Conversation

@0xtlt

@0xtlt 0xtlt commented Jul 28, 2026

Copy link
Copy Markdown
Owner

What changed

  • remove the compact, project-specific Rust grammar override;
  • use Typst's complete Syntect/two-face catalog with the native Oniguruma backend;
  • add a precompiled Liquid TextMate grammar with embedded HTML, CSS, JSON, and JavaScript dependencies;
  • keep unknown language identifiers on a safe plain-text fallback;
  • retain jemalloc and early Typst-engine release from the profiling pass;
  • document the architecture, tested identifiers, visual fixture, and updated benchmarks.

Impact

HTML, CSS, Liquid, JavaScript, TypeScript, JSON, YAML, TOML, Python, Rust, Go, Java, C/C++, Bash, and SQL are explicitly verified. Default code blocks remain free of line numbers.

Compared with version 3.0.1, version 3.2 lowers median conversion time by 38–58%, peak RAM by 9–22%, and CPU cycles by 35–53%. The former version 3.1 Rust fast path was deliberately removed because it was not the general-purpose highlighting architecture required by the project.

Validation

  • cargo fmt --check
  • cargo clippy --all-targets --all-features --locked -- -D warnings
  • cargo test --locked (18 tests)
  • RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --locked
  • optimized release build and ad-hoc code-sign verification
  • 1-, 40-, and 240-page performance/resource fixtures
  • PDF 1.7 parsing and text extraction
  • rendered one-page HTML/CSS/Liquid/JavaScript/Python/Rust visual fixture
  • default line-number behavior verified

@0xtlt 0xtlt changed the title Optimize rendering performance and memory use Use production syntax highlighting grammars Jul 28, 2026
@0xtlt
0xtlt marked this pull request as ready for review July 28, 2026 20:30
@cursor

cursor Bot commented Jul 28, 2026

Copy link
Copy Markdown

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.

@0xtlt
0xtlt merged commit d30f200 into main Jul 28, 2026
2 checks passed
@0xtlt
0xtlt deleted the agent/optimize-3-1 branch July 29, 2026 05:57
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