Skip to content

Conversation

@Div627
Copy link
Contributor

@Div627 Div627 commented Nov 10, 2025

中文版模板 / Chinese template

🤔 This is a ...

  • 🆕 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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

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.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

Preview failed

@dosubot dosubot bot added the enhancement New feature or request label Nov 10, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Div627, I'm Gemini Code Assist1! 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-markdown against other popular Markdown rendering libraries, including marked, markdown-it, react-markdown, and streamdown.
  • Robust Test Data: A large and complex test.md file 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 👍 and 👎 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.

Footnotes

  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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive performance benchmark for streaming Markdown rendering using Playwright, which is a valuable addition for evaluating and comparing different rendering libraries. The overall implementation is solid. My review focuses on improving code quality, maintainability, and the robustness of the testing setup. I've included suggestions for using proper TypeScript types, avoiding hardcoded values, ensuring test failures are correctly reported, and optimizing component rendering logic within the benchmark.


await page.context().tracing.start({
screenshots: true,
title: `XMarkdown_Stream_Perf_${browserName}`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The trace title is not unique per renderer. When running multiple benchmark tests, this can make it harder to distinguish between traces. Including the renderer name in the title will make each trace uniquely identifiable.

Suggested change
title: `XMarkdown_Stream_Perf_${browserName}`,
title: `XMarkdown_Stream_Perf_${name}_${browserName}`,

@codecov
Copy link

codecov bot commented Nov 10, 2025

Bundle Report

Changes will increase total bundle size by 1.21MB (35.83%) ⬆️⚠️, exceeding the configured threshold of 5%.

Bundle name Size Change
antdx-array-push 2.96MB 1.21MB (68.78%) ⬆️⚠️

Affected Assets, Files, and Routes:

view changes for bundle: antdx-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
antdx.js (New) 2.96MB 2.96MB 100.0% 🚀
antdx.min.js (Deleted) -1.76MB 0 bytes -100.0% 🗑️

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

size-limit report 📦

Path Size
packages/x/dist/antdx.min.js 439.19 KB
packages/x-sdk/dist/x-sdk.min.js 7.3 KB
packages/x-markdown/dist/x-markdown.min.js 28.8 KB
packages/x-markdown/dist/plugins/latex.min.js 61.95 KB

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 14, 2025

Deploying ant-design-x with  Cloudflare Pages  Cloudflare Pages

Latest commit: c450fbe
Status: ✅  Deploy successful!
Preview URL: https://31ae82be.ant-design-x.pages.dev
Branch Preview URL: https://feature-markdown-benchmark.ant-design-x.pages.dev

View logs

@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

❌ Patch coverage is 0% with 215 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.50%. Comparing base (aec2601) to head (c450fbe).

Files with missing lines Patch % Lines
...XMarkdown/__benchmark__/tests/performance.spec.tsx 0.00% 196 Missing ⚠️
...down/__benchmark__/components/MarkdownRenderer.tsx 0.00% 14 Missing ⚠️
.../XMarkdown/__benchmark__/tests/benchmark.config.ts 0.00% 4 Missing ⚠️
...rc/XMarkdown/__benchmark__/playwright-ct.config.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           feature    #1314      +/-   ##
===========================================
- Coverage    94.54%   89.50%   -5.05%     
===========================================
  Files          136      140       +4     
  Lines         3816     4031     +215     
  Branches      1085     1135      +50     
===========================================
  Hits          3608     3608              
- Misses         205      420     +215     
  Partials         3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@socket-security
Copy link

socket-security bot commented Dec 3, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedhusky@​9.1.71001006280100
Addeddekko@​0.2.1981008877100
Addedsize-limit@​11.2.01001008087100
Addedmarked-emoji@​2.0.2811009887100
Addedfather@​4.6.8931008198100
Addedgh-pages@​6.3.09910010083100
Addedreact-markdown@​10.1.09910010086100
Addedprettier@​3.7.4901009799100
Addedlint-staged@​16.2.710010010094100

View full report

@Div627 Div627 changed the base branch from next to feature December 3, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants