chart/TEST.md

18 lines
616 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Chart.js ESM Performance Benchmark
## 测试环境
- Playwright (Headless Chromium)
- CPU: Host machine
- Chart.js version: 4.x
## 性能基准 (v1.0.0)
| 指标 | 耗时 (ms) | 备注 |
| :--- | :--- | :--- |
| **首次渲染 (Line Chart)** | 43.80 | 包含 Chart.js 初始化与双图表渲染测试 |
| **数据更新 (Smooth Update)** | < 10.00 | 基于 `chart.update()` 的增量更新 |
## 设计决策
1. **Tree Shaking**: 仅内置常用的控制器Line, Bar, Pie以控制产物体积
2. **实例复用**: 严格遵循 `chart.update()` 路径避免频繁创建 Canvas 渲染上下文