I'm facing extremely slow load times for webpages when using selenium and firefox. A page like
yahoo.com or
google.com takes several seconds (usually around 10s; if I load it twice, second time is around 5s). I can't find out why, any ideas? I'll detail below what I've done to isolate the problem.
First, versions: it's a headless server using Xvfb with Centos 64 bits 6.6, Selenium 2.44, Firefox 31.3. I tried Java 1.6 and 1.7, no changes. The server has a DNS cache server, which means that it's not a DNS problem. Curl fetches these pages instantly. It makes no difference if pages are in remote hosts or localhost, even when domain resolves to 127.0.0.1. I tried both PHP (with codeception and selenium JAR) and Python bindings (pip, also v2.44), both are slow (for these tests I'm using a simple Python program with nothing except a browser.get() call). Server has plenty of RAM and low load.
Now, some positive results: downloading a single image instead of a webpage is fast (< 0.5s). A blank page is also very fast. Adding CSS and JS slows down the page, and *seems* to be the culprit. I also noticed a high sys% time when running the tests (around 10%, versus near zero when test is not running). Since it's headless on a remote server it's difficult to see what is happening in the browser.
If anybody has *any* idea of what might be causing this issue or suggestions to debug, fix... anything is appreciated. Really, no matter how crazy or simple, please post.