feat(XMarkdown): streaming markdown benchmark
🤔 This is a ...
- [x] 🆕 New feature
- [ ] 🐞 Bug fix
- [ ] 📝 Site / documentation improvement
- [ ] 📽️ Demo improvement
- [ ] 💄 Component style improvement
- [ ] 🤖 TypeScript definition improvement
- [ ] 📦 Bundle size optimization
- [ ] ⚡️ Performance optimization
- [ ] ⭐️ Feature enhancement
- [ ] 🌐 Internationalization
- [ ] 🛠 Refactoring
- [ ] 🎨 Code style optimization
- [ ] ✅ Test Case
- [ ] 🔀 Branch merge
- [ ] ⏩ Workflow
- [ ] ⌨️ Accessibility improvement
- [ ] ❓ Other (about what?)
🔗 Related Issues
This PR implements the benchmark proposed in the RFC:
- RFC Discussion: #1313
- RFC Title: "[RFC] 流式 Markdown Benchmark"
💡 Background and Solution
- 本方案提出一个基于 Playwright Component Testing 的标准化流式 Markdown 渲染性能基准测试,通过统一接口、标准数据集和自动化指标采集,填补前端生态在增量渲染场景下缺乏可量化、可复现性能评估工具的空白,支持 CI 集成与技术选型。
📝 Change Log
- 基于 Playwright Component Testing 实现流式 Markdown 渲染性能基准测试。
| Language | Changelog |
|---|---|
| 🇺🇸 English | |
| 🇨🇳 Chinese |
[!IMPORTANT]
Review skipped
Auto reviews are disabled on base/target branches other than the default branch.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.
[!NOTE]
Other AI code review bot(s) detected
CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.
✨ Finishing touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
feature_markdown_benchmark
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
Summary of Changes
Hello @Div627, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces a new, standardized performance benchmark for streaming Markdown rendering. It utilizes Playwright Component Testing to automate the measurement of various Markdown libraries, including x-markdown, marked, markdown-it, react-markdown, and streamdown. The goal is to provide quantifiable metrics like duration, FPS, and memory usage for incremental rendering scenarios, which will be valuable for continuous integration and informed technology selection within the frontend ecosystem.
Highlights
- New Benchmark Suite: Introduced a new performance benchmark suite specifically designed for streaming Markdown rendering, addressing a gap in quantifiable performance evaluation for incremental rendering.
- Playwright Integration: The benchmark leverages Playwright Component Testing for standardized and automated collection of performance metrics, ensuring reproducible results.
-
Comprehensive Comparison: The suite compares the performance of
x-markdownagainst other popular Markdown rendering libraries, includingmarked,markdown-it,react-markdown, andstreamdown. -
Robust Test Data: A large and complex
test.mdfile has been added to serve as a standardized dataset, simulating real-world Markdown content to stress-test parsers effectively. - Metric Collection: The benchmark measures key performance indicators such as rendering duration, average FPS, and memory usage during the streaming process.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
[^1]: Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.
Bundle Report
Changes will increase total bundle size by 10.83kB (0.58%) :arrow_up:. This is within the configured threshold :white_check_mark:
Detailed changes
| Bundle name | Size | Change |
|---|---|---|
| x-markdown-array-push | 117.77kB | 10.83kB (10.13%) :arrow_up: |
Affected Assets, Files, and Routes:
view changes for bundle: x-markdown-array-push
Assets Changed:
| Asset Name | Size Change | Total Size | Change (%) |
|---|---|---|---|
x-markdown.min.js |
7.21kB | 111.41kB | 6.92% :warning: |
x-markdown.min.css |
3.62kB | 6.36kB | 131.76% :warning: |
size-limit report 📦
| Path | Size |
|---|---|
packages/x/dist/antdx.min.js |
441.23 KB |
packages/x-sdk/dist/x-sdk.min.js |
7.88 KB |
packages/x-markdown/dist/x-markdown.min.js |
30.5 KB (+1.59 KB 🔺) |
packages/x-markdown/dist/plugins/latex.min.js |
61.95 KB |
Deploying ant-design-x with
Cloudflare Pages
| Latest commit: |
be2b3cf
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bbca493d.ant-design-x.pages.dev |
| Branch Preview URL: | https://feature-markdown-benchmark.ant-design-x.pages.dev |
Codecov Report
:x: Patch coverage is 99.13793% with 1 line in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 97.20%. Comparing base (f6073ce) to head (be2b3cf).
:warning: Report is 1 commits behind head on feature.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| ...x-markdown/src/XMarkdown/DebugPanel/DebugPanel.tsx | 99.13% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## feature #1314 +/- ##
===========================================
+ Coverage 97.15% 97.20% +0.05%
===========================================
Files 140 141 +1
Lines 4328 4444 +116
Branches 1205 1248 +43
===========================================
+ Hits 4205 4320 +115
- Misses 121 122 +1
Partials 2 2
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
| Diff | Package | Supply Chain Security |
Vulnerability | Quality | Maintenance | License |
|---|---|---|---|---|---|---|
| dekko@0.2.1 | ||||||
| father@4.6.13 | ||||||
| gh-pages@6.3.0 |
⚠️ Performance benchmark report not found.
This comment is automatically generated by the x-markdown performance CI.
⚠️ Performance benchmark report not found.
This comment is automatically generated by the x-markdown performance CI.
⚠️ Performance benchmark report not found.
This comment is automatically generated by the x-markdown performance CI.
⚠️ Performance benchmark report not found.
This comment is automatically generated by the x-markdown performance CI.
⚠️ Performance benchmark report not found.
This comment is automatically generated by the x-markdown performance CI.
⚠️ Performance benchmark report not found.
This comment is automatically generated by the x-markdown performance CI.
[!WARNING] Review the following alerts detected in dependencies.
According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
| Action | Severity | Alert (click "▶" to expand/collapse) |
|---|---|---|
| Warn | Protestware or unwanted behavior: npm
|
|
| Warn | Protestware or unwanted behavior: npm
|
⚠️ Performance benchmark report not found.
This comment is automatically generated by the x-markdown performance CI.
⚠️ Performance benchmark report not found.
This comment is automatically generated by the x-markdown performance CI.
⚠️ Performance benchmark report not found.
This comment is automatically generated by the x-markdown performance CI.
