-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How much faster is Electron compared to PhantomJS? #484
Comments
Certainly. Here's some results from awhile back. This is from an old email. Phantom has been very slow for us, and so I was experimenting around with using Electron as a web driver in instead. It turns out Electron is quite a bit faster. Here's some of the benchmarks for selecting Nightmare (via Phantom):
Nightmare (via Electron):
|
@matthewmueller You wouldn't happen to have the benchmarking code would you? I did some basic benchmarking on a 2016 Macbook Pro between Nightmare (using Electron) and Capybara with PoltergeistJS (Ruby interface to PhantomJS), and Nightmare is usually around 1.5x - 2.5x slower for me |
It is unclear to me what those benchmark numbers even mean or if they are even accurate... I ran Nightmare locally and Electron takes 2300ms~ to get page title from google.com, this is using the latest build available on NPM. A truly fast headless browser - zombie.js, the results are very promising: 700ms~ to get page title from google.com |
@boxtown weird maybe phantom has improved a lot since these were run. Don't have the old code on me, but you can probably just download nightmare 1.x and nightmare 2.x to run them side by side. @abacaj if you can use a headless browser with a fake DOM implementation, then you should. Last I checked zombie was still using jsdom, you could improve that further with cheerio. Nightmare is built for sites that are javascript heavy and need to be able to run the client-side javascript code. |
https://github.com/laggingreflex/scrapers-benchmarks
|
@laggingreflex I get quite different results.
request, zombie and nightmare are around 3x-4x faster on my machine which seems consistent. But phantom is slower by around 50%, which doesn't make sense. What could be the reason? My results are closer to what @matthewmueller posted, which is: nightmare is around 3x faster than phantom. Also I believe that request is not a full stack browser. As it is described on github
So it should not be benchmarked against full-stack headless browsers. Final results |
Just want to point out that Zombie being faster is to be expected. It uses JSDOM underneath, so if you can get away with using Zombie, you should. The problem is that any JS-heavy website wouldn't work with Zombie. |
You state:
Can you show us some proof like benchmarks or documentation to proof that?
Greets
The text was updated successfully, but these errors were encountered: