gruntjs / gruntjs/grunt-lib-phantomjs

Use WebSockets for IPC instead of file I/O

Open
#36 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
93
Forks
56
PR merge metrics
No merged PRs in 30d

Description

Using grunt-contrib-qunit (and likely the similar plugin tasks for other test frameworks) is incredibly slow on Windows due to the very chatty "eventing" file I/O that the two libraries exchange. Since Windows sucks at file I/O (file open-lock-write-close), this makes using grunt-contrib-qunit on our fairly large existing test base take ~22 minutes versus the ~4 minutes it takes when we run them via our own non-chatty PhantomJS script.

To prove that the file I/O was the primary cause of the slowness, we also tried switching over to using streaming stdout/stderr instead of file I/O. This cut the time down to ~9 minutes but that was still much too slow compared to the current ~4 minutes.

I would love to see grunt-contrib-qunit/grunt-lib-phantomjs use WebSockets for IPC with PhantomJS instead of file I/O. The only major caveat is that the current versions of PhantomJS (1.x) only support hixie-76 draft WebSockets, so it can be a little tricky in getting them to work with other WebSockets libraries that are geared toward the modern specs. However, I know it has been successfully done by the [Poltergeist project](https://github.com/jonleighton/poltergeist), using Ruby's faye-websocket and later websocket-driver), the [phantom Node module](https://github.com/sgentle/phantomjs-node) using SockJS, and likely others.

Perhaps try out the Faye project's [websocket-driver module for Node](https://github.com/faye/websocket-driver-node) or SockJS?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.