Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upHow 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. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

You state:
Can you show us some proof like benchmarks or documentation to proof that?
Greets