Permalink
Browse files

Record some benchmarks for different transport types.

  • Loading branch information...
1 parent a1154da commit 2854f0523c4b585fbf57255b1746bc5ca2a43496 @jcoglan jcoglan committed Sep 21, 2011
Showing with 53 additions and 8 deletions.
  1. +43 −0 examples/benchmarks.txt
  2. +5 −4 examples/node/benchmark.js
  3. +5 −4 examples/ruby/benchmark.rb
View
@@ -0,0 +1,43 @@
+Benchmarks for connection types
+===============================
+
+Environment:
+ * MacBook Air, OSX 10.6
+ * Ruby 1.9.2
+ * Node 0.4.9
+
+
+Server: node examples/node/server.js 8000
+-----------------------------------------
+
+Node client (HTTP): 2400ms
+Node client (WS): 1100ms
+Ruby client (HTTP): 5300ms
+Ruby client (WS): 1900ms
+
+
+Server: node examples/node/server.js 8000 ssl
+---------------------------------------------
+
+Node client (HTTP): 20000ms
+Node client (WS): 3300ms
+Ruby client (HTTP): 18000ms
+Ruby client (WS): 3100ms
+
+
+Server: ruby examples/ruby/server.rb 8000
+-----------------------------------------
+
+Node client (HTTP): 5500ms
+Node client (WS): 4000ms
+Ruby client (HTTP): 7100ms
+Ruby client (WS): 4100ms
+
+
+Server: ruby examples/ruby/server.rb 8000 ssl
+---------------------------------------------
+
+Node client (HTTP): ---
+Node client (WS): ---
+Ruby client (HTTP): 19000ms
+Ruby client (WS): 4400ms
@@ -1,10 +1,11 @@
var faye = require('../../build/faye-node'),
- port = process.argv[2] || 8000,
- path = process.argv[3] || 'bayeux';
+ port = process.argv[2] || 8000,
+ path = process.argv[3] || 'bayeux',
+ scheme = process.argv[4] === 'ssl' ? 'https' : 'http';
-var A = new faye.Client('http://localhost:' + port + '/' + path),
- B = new faye.Client('http://localhost:' + port + '/' + path);
+var A = new faye.Client(scheme + '://localhost:' + port + '/' + path),
+ B = new faye.Client(scheme + '://localhost:' + port + '/' + path);
A.connect(function() {
B.connect(function() {
@@ -3,12 +3,13 @@
dir = File.dirname(__FILE__)
require File.expand_path(dir + '/../../lib/faye')
-port = ARGV[0] || 9292
-path = ARGV[1] || 'bayeux'
+port = ARGV[0] || 9292
+path = ARGV[1] || 'bayeux'
+scheme = ARGV[2] == 'ssl' ? 'https' : 'http'
EM.run {
- A = Faye::Client.new("http://localhost:#{port}/#{path}")
- B = Faye::Client.new("http://localhost:#{port}/#{path}")
+ A = Faye::Client.new("#{scheme}://localhost:#{port}/#{path}")
+ B = Faye::Client.new("#{scheme}://localhost:#{port}/#{path}")
A.connect do
B.connect do

0 comments on commit 2854f05

Please sign in to comment.