Skip to content

[Regression]: Webkit 6 times CPU load since 1.59.0 #42396

Description

@nihiloid

Last Good Version

1.58.2

First Bad Version

1.59.0

Steps to reproduce

Playwright WebKit Runs WebKit CPU-sec (median) Range Session sec (median) CPU per sec (median) Peak % (median) Node CPU-sec (median)
1.50.1 2123 5 5.2 4.3-7.1 43 0.123 119 1.6
1.51.1 2140 5 10.3 1.7-26.3 91 0.085 134 2.4
1.52.0 2158 5 5.3 1.0-60.7 43 0.116 129 1.4
1.53.2 2182 5 4.1 3.9-47.5 44 0.099 119 1.5
1.54.2 2191 5 5.1 4.0-9.8 43 0.104 124 1.5
1.55.1 2203 5 5.0 1.1-12.2 39 0.103 124 1.4
1.56.1 2215 5 5.3 4.0-24.7 46 0.094 119 1.5
1.57.0 2227 5 6.3 4.4-9.4 43 0.108 119 1.6
1.58.2 2248 5 5.2 4.3-13.0 44 0.103 124 1.8
1.59.0 2272 5 36.3 31.2-156.2 44 0.737 373 1.3
1.59.1 2272 5 88.4 27.9-129.8 45 0.638 381 1.3
1.60.0 2287 5 28.5 26.1-63.1 43 0.640 366 1.3
1.61.1 2311 5 30.5 25.0-187.0 48 0.527 365 1.4
1.62.1 2336 5 72.7 30.8-242.0 47 0.659 383 1.4

Grouped by WebKit revision

WebKit Playwright versions median CPU per sec range median peak
18.2-18.5 1.50.1, 1.51.1, 1.52.0, 1.53.2 0.107 0.085-0.123 ~120%
26.0 1.54.2, 1.55.1, 1.56.1, 1.57.0, 1.58.2 0.103 0.094-0.108 ~120%
26.4, 26.5 1.59.0, 1.59.1, 1.60.0, 1.61.1, 1.62.1 0.640 0.527-0.737 ~375%

WebKit 26.4 and later use about 6 times the CPU of every earlier revision for
the same work, at the same session length.

1.59.0 and 1.59.1 ship the same WebKit build (2272), and both sit in the heavy
group at 0.737 and 0.638 CPU per sec. The step therefore comes with the WebKit
build, not with a change in the playwright-core layer between those two
patches. 1.58.2 (WebKit 2248, 26.0) is the last version before the step.

Method

  • 14 Playwright builds, 5 counted runs each, one Docker container per version.
    13 minors from 1.50 up, plus 1.59.0 next to 1.59.1 to separate the
    playwright-core layer from the WebKit build.
  • Workload: live run against real webite device descriptor pinned to one iPhone fixture.
  • CPU sampled from /proc every 200 ms over the whole WebKit process tree,
    cross-checked against cgroup v2 cpu.stat for the container.
  • Container pinned to --cpuset-cpus 0-3, so 400% is the ceiling.

Confidence

  • The 6x step at WebKit 26.4 is far larger than any noise in this data, is
    reproduced by 5 independent Playwright versions across 25 runs, and shows in
    the cgroup counter as well as the /proc sampler. It is real.

Expected behavior

No elevated CPU load

Actual behavior

Webkit with Playwright patches consumes 6 times CPU load since 1.59.0 with bundled Webkit 26.4

Additional context

MacOS 26.6 M4Max running Docker container

Environment

System:                                                                                    
      OS: Linux 6.10 Debian GNU/Linux 12 (bookworm) 12 (bookworm)                              
      CPU: (16) arm64 unknown                                                                  
      Memory: 6.40 GB / 7.65 GB                                                                
      Container: Yes                                                                           
    Binaries:                                                                                  
      Node: 22.23.2 - /usr/bin/node                                                            
      npm: 12.0.2 - /usr/bin/npm                                                               
    Languages:                                                                                 
      Bash: 5.2.15 - /usr/bin/bash                                                             
    npmPackages:                                                                               
      playwright: 1.59.0 => 1.59.0

Activity

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

Metadata

Metadata

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