https://github.com/dream-num/univer-benchmark
https://github.com/dream-num/univer-benchmark
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dream-num/univer-benchmark
- Owner: dream-num
- License: apache-2.0
- Created: 2024-03-16T03:05:17.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-20T13:17:18.000Z (7 months ago)
- Last Synced: 2025-01-24T04:38:07.584Z (5 months ago)
- Language: TypeScript
- Size: 1.83 MB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# univer-benchmark
`CostReporter.ts` is a simple benchmarking tool for the Univer project. It only counts the duration consumed by the steps we focus on.
Run with `--workers=1` to avoid performance impact caused by concurrency.
## How to install
```bash
pnpm install
```## How to run
run with ui
```bash
pnpm benchmark --ui
```run with headed
```bash
pnpm benchmark --ui --headed
```run once
```bash
pnpm benchmark
```run n times
```bash
pnpm benchmark --repeat-each=3
pnpm benchmark --repeat-each=10
```run with a regular filter, only run the test with the name contains 'raw load'
```bash
pnpm benchmark -g "raw load"
```## How to write a new test
```typescript
test(`new test`, async ({ page }) => {
await page.goto('/');
// wait for the page to be ready or to Pre work// The internal time of the step named 'timeCost' will only be counted
await test.step('timeCost', async () => {
// do something
})
});
```## Troubleshooting
- Maybe you need check the `playwright.config.ts` file to see if the `projects` options are suitable for your environment.
- the timeout of the test is set to 10s, you can change it in the `playwright.config.ts` file.## Reference
- [Writing Playwright tests](https://playwright.dev/docs/intro)