Skip to content

[Bug]: Noticeable performance slowdown with trace enabled in Playwright 1.46 #32746

Closed

Description

@ibrocodes7

Version

1.46.0

Steps to reproduce

  1. Set up Playwright version 1.46 with two test cases.
  2. Run the tests with the trace configuration set to off:
{
    trace: 'off'
}
  1. Measure the time taken to complete the test run.
  2. Now, run the same tests with the trace configuration set to on:
    trace: {
      mode: 'retain-on-failure',
      screenshots: false,
      snapshots: true,
      sources: false,
      attachments: false,
    },
  1. Measure the time taken to complete the test run with trace enabled.

Expected behavior

The performance overhead with trace enabled should be minimal, and the time difference between running tests with trace on and off should be negligible.

Actual behavior

With trace off, the test run completes in 1.8 minutes.
With trace on, the test run completes in 2.1 minutes.

Additional context

No response

Environment

System:
    OS: macOS 14.6.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 1.20 GB / 16.00 GB
  Binaries:
    Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
    npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm
    pnpm: 7.6.0 - ~/thoughtspot/node_modules/.bin/pnpm
  IDEs:
    VSCode: 1.93.1 - /usr/local/bin/code
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/test: 1.46.0 => 1.46.0

Activity

  1. mxschmitt commented on Sep 21, 2024

    @mxschmitt
    Contributor

    Is this something which got worse with Playwright v1.46? Its expected that tests will run slower when you are running your tests with tracing enabled, hence we recommend on-first-retry. Especially when your web app which you are testing is big, since we record snapshots, network requests etc. 1.8 -> 2.1 sounds reasonable for that.

    If this is something which got worse in v1.46 - we need a reproduction in order to investigate what caused it.

  2. ibrocodes7 commented on Sep 21, 2024

    @ibrocodes7
    Author

    Yes, compared to version 1.24, which we’re currently using, the newer version is noticeably slowing down the app, and this is causing some tests to fail. In version 1.24, even with the trace configuration: trace: { mode: 'retain-on-failure', screenshots: true, snapshots: true, sources: true,} the sources weren’t included in the report.

    I thought this might have contributed to the slowdown, so I tested version 1.46 with sources: false, but the sources are still being captured. I’ve reported this issue here: 32745https://github.com/microsoft/playwright/issues/32745

  3. mxschmitt commented on Sep 21, 2024

    @mxschmitt
    Contributor

    We unfortunately need a reproduction in order to figure out which exact Playwright change caused the performance regression you are encountering. If the performance in v1.46 is significant worse compared to v1.24 then we'd love to dig deeper into this, for that we need something we can run locally or you are manually checking which Playwright version caused it (we also have daily builds on NPM).

    For the sources issue, it looks indeed like a bug, I can repro and we'll triage it in #32745.

  4. yury-s commented on Sep 25, 2024

    @yury-s
    Member

    We need more information to act on this report. Once you have a repro, please file a new issue and provide it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions