Skip to content

[Bug] Initial browser launch time inconsistent #4345

Closed

Description

@jperl

Context:

  • Playwright Version: 1.3.0, 1.4.2, 1.5.2
  • Operating System: Linux
  • Node.js version: 10.22.1
  • Browser: Chromium

Code Snippet

https://github.com/jperl/pw-perf-1

Describe the bug

1 out of every 2-3 times the cold start launch time takes much longer (~5-8 seconds vs ~0.5 seconds).

v1.5.2

6.3s, 0.4s, 0.3s, 6.4s, 0.4s, 5s, 8.1s, 0.7s, 0.4s, 0.4s, 5s

v1.4.2

0.4s, 6.6s, 0.3s, 0.4s, 7.4s, 0.4s, 6s, 0.3s, 0.4s, 0.3s, 8s

v1.3.0
0.4s, 3.5s, 6s, 8s, 0.4s, 0.4s, 4.2s, 0.4s, 7.2s, 1.6s, 0.9s

I do not know if this is GitHub Actions specific or an issue with Playwright but on smaller servers (1cpu) I have seen cold start take 15s. I thought I should report this in case it is a potential performance issue.

Activity

  1. changed the title [-][Question] Initial browser launch time inconsistent[/-] [+][Bug] Initial browser launch time inconsistent[/+] on Nov 4, 2020
  2. JoelEinbinder commented on Nov 5, 2020

    @JoelEinbinder
    Contributor

    Note: these are running headful chromium.

    headless chromium is highly optimized for cold startup. Headful chrome is not. It writes a ton of things to disk and starts up all sorts of services. That combined with the nature of github actions makes me not surprised by the results you are getting. I agree that 10 seconds is a poor user experience. But I'd say use headless if you have any expectation of speed.

    However it is possible (but unlieky) that we are idling waiting for some event that just sometimes happens late. For me to blame chromium, I'd want to compare headless webkit vs headless chromium launch times and see that webkit is never slow.

  3. yury-s commented on Nov 10, 2020

    @yury-s
    Member

    Looks this is specific to the virtual machines that GHA uses, I tried it locally with forced cpu affinity and the numbers are very consistent:

    ~/pw-perf-1/152(master)$ taskset 1 node perf.js               
    timing {                                                                                                                                                                                                                                                                          
      launchBrowser: [                                                  
        343, 312, 355, 341,                                             
        350, 329, 348, 338,                                             
        337, 354                                                        
      ],                                                                
      launchContext: [                                                  
        13, 11, 8, 11, 15,                                              
        11, 19, 7,  8,  8                                               
      ],                                                                
      launchPage: [                                                     
        243, 246, 231, 234,                                             
        231, 233, 228, 241,                                             
        236, 237                                                        
      ],                                                                
      close: [                                                          
        67, 59, 66, 64, 96,                                             
        83, 86, 66, 96, 60                                              
      ],                                                                
      total: [                                                          
        666, 628, 660, 650,                                             
        692, 656, 681, 652,                                             
        677, 659                                                        
      ]                                                                 
    }                                                                   
    launchBrowser: 340.7                                                
    launchContext: 11.1                                                 
    launchPage: 236                                                     
    close: 74.3                                                         
    total: 662.1                                                        

    If I clear Linux caches first launch takes longer but the rest are very consistent:

    $ taskset 1 node perf.js 
    timing {                  
      launchBrowser: [                    
        607, 342, 361, 328,                                                                                                                  
        357, 359, 353, 366,                                                                                                                  
        354, 370                                                                                                                             
      ],
    
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