headless performance

1,429 views
Skip to first unread message

isaac....@gmail.com

unread,
Jun 30, 2016, 12:25:41 AM6/30/16
to headless-dev
Hello again,
Just wanted to do some quick performance testing of headless vs chromium with xvfb. I ran a simple test of loading http://www.independent.co.uk (which is my goto site for bad performance) 3 times, using Page.loadEventFired to signal when to reload. Using chromium + xvfb it takes 39 seconds to load it 3 times. With headless chrome it took 129 seconds. I also notice CPU% is far higher for much longer running in headless versus chromium + xvfb.

Granted my tests are in no way scientific, is higher cpu usage and time to load pages an expected result?

Thanks,
-Isaac

Sami Kyostila

unread,
Jun 30, 2016, 5:35:36 AM6/30/16
to isaac....@gmail.com, headless-dev

Hi Isaac,

We haven't really started optimizing for performance yet, but still, that level of overhead isn't expected. It might be interesting to compare chrome traces between the two runs. You can record one with both browsers using these command line flags:

$ headless_shell --trace-startup=* --trace-startup-duration=10 --remote-debugging-port=9222 http://www.independent.co.uk

You may need to adjust the duration. The remote debugging port flag makes sure headless shell doesn't shut down in the middle of tracing. Please file a bug at crbug.com if you want to share the traces with us.

One overhead we haven't addressed yet is the compositor which is running at 60 Hz by default, but I'd be a little surprised if its impact is that high.

- Sami

--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/021d3fa5-01c9-4f97-9ed7-a6cae6b169fb%40chromium.org.

Eric Seckler

unread,
Jun 30, 2016, 5:43:24 AM6/30/16
to Sami Kyostila, isaac....@gmail.com, headless-dev
Hi Isaac,

Another thing to check is that you're compiling and running a non-debug build of headless (debug builds are significantly slower). And as Sami said, we welcome traces :)

Thanks for experimenting with Headless!
Eric


Isaac Dawson

unread,
Jun 30, 2016, 5:47:33 AM6/30/16
to Eric Seckler, Sami Kyostila, headless-dev
*facepalm* yeah I should probably build in release mode. I'll rerun my tests with traces after just to confirm, but that obviously explains what I was seeing!

Thanks again!
-Isaac

isaac....@gmail.com

unread,
Jul 10, 2016, 9:00:51 PM7/10/16
to headless-dev, isaac....@gmail.com
Finally got around to re-running in Release, loading independent.co.uk 10 times now completes in 81 seconds compared to chromium+xvfb's 96 seconds. Much better,
Thanks again!
-Isaac

Alex Clarke

unread,
Jul 11, 2016, 5:05:19 AM7/11/16
to Isaac Dawson, headless-dev
Thanks for the datapoint! We haven't done any performance tuning so far, so I'm glad to hear it was a bit faster.

Reply all
Reply to author
Forward
0 new messages