Skip to content

Reporter performance regression 0.34.x - 1.0.0 #4710

@AriPerkkio

Description

@AriPerkkio

Describe the bug

Reporters which clear screen during logging (any non-CI reporter) can cause too much stress on main thread. Once main thread spends all its time resolving what to print on screen, it blocks new tests from starting.

During the beta releases the log-update dependency was updated to new major version. It was supposed to fix performance issues but actually it introduces some more. Downgrading log-update to previous major fixes these issues immediately.

Tip

Work-around for anyone running into this issue with 1.0.2 and below:
Switch to reporters: "basic"

Performance profiles from main thread:

v1.0.2

On top row the functions are coming from log-update and its various dependencies.

image

v1.0.2 after downgrading log-update

Test execution drops by 66% on the reproduction case.

See how main thread spends most of its time on idle part. That's a good thing as main thread should spend most its time just waiting for test runner threads/forks.

image

Reproduction

Use reproduction case from #3006.

System Info

System:
    OS: macOS 14.1.2
    CPU: (8) arm64 Apple M2
    Memory: 2.06 GB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
    Yarn: 1.22.21 - ~/.nvm/versions/node/v18.17.1/bin/yarn
    npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm
    pnpm: 8.11.0 - ~/.nvm/versions/node/v18.17.1/bin/pnpm
    bun: 1.0.3 - ~/.bun/bin/bun
  Browsers:
    Brave Browser: 116.1.57.53
    Chrome: 119.0.6045.199
    Safari: 17.1.2
  npmPackages:
    @vitest/browser: * => 1.0.2 
    vite: * => 5.0.0-beta.3 
    vitest: * => 1.0.2

Used Package Manager

pnpm

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions