Skip to content

Add interactive performance benchmark demo - #200

Open
nankai-mz wants to merge 1 commit into
chenglou:mainfrom
nankai-mz:add-benchmark-tool
Open

Add interactive performance benchmark demo#200
nankai-mz wants to merge 1 commit into
chenglou:mainfrom
nankai-mz:add-benchmark-tool

Conversation

@nankai-mz

Copy link
Copy Markdown

Summary

This PR adds an interactive performance benchmark tool at /demos/benchmark/ that compares Pretext's prepare()/layout() against traditional DOM measurement across multiple dimensions:

  • 6 text types: English, Chinese, Mixed, Emoji, Arabic, Emoji-Mixed
  • 4 text lengths: Short, Medium, Long, Extra Long
  • Configurable: Container width, line height, font size, iterations
  • Visual results: Bar charts, line charts, and heatmaps (Chart.js)
  • Report export: Download benchmark results

Why this matters

Pretext claims significant performance advantages over DOM measurement. This tool makes those claims verifiable and visual—helping developers understand exactly where and when Pretext provides the biggest wins.

Screenshots

The demo works as a static SPA (Vite + React + TypeScript + Tailwind CSS + Chart.js).

Source

Built from nankai-mz/pretext-benchmark.

- Adds a community-contributed interactive benchmark tool to /demos/benchmark/
- Compares Pretext prepare()/layout() performance vs traditional DOM measurement
- Supports multiple text types (English, Chinese, Mixed, Emoji, Arabic, Emoji-Mixed)
- Configurable text length, container width, line height, font size, and iterations
- Visual results: bar charts, line charts, and heatmaps via Chart.js
- Report export feature for sharing benchmark results
- Source: https://github.com/nankai-mz/pretext-benchmark
This was referenced Jun 22, 2026
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