dream-num / univer-benchmark

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

pnpm install

How to run

run with ui

pnpm benchmark --ui

run once

pnpm benchmark

run n times

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'

pnpm benchmark -g "raw load"

How to write a new test

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

About

License:Apache License 2.0


Languages

Language:TypeScript 99.9%Language:JavaScript 0.1%Language:HTML 0.0%Language:CSS 0.0%