websocket vs XHR (v2)

Revision 2 of this benchmark created on


Description

Websockets doesn't work in some firefox browsers unless you enable it. https://developer.mozilla.org/en/WebSockets

Test runner

Ready to run.

Testing in
TestOps/sec
websocket
var c = new WebSocket('ws://echo.websocket.org');
c.addEventListener('message', function(e) {
  this.close();
}, false);
c.addEventListener('open', function() {
  this.send('ping');
}, false);
ready
XHR
// async test
var x = new XMLHttpRequest();
x.open('POST', 'http://onechannelproject.com/ping.php', true);
x.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
x.addEventListener('load', function() {
  return;
}, false);
x.send('req=ping');
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.