Permalink
Browse files

a little pile of pages useful for performance testing

  • Loading branch information...
lloyd committed Sep 25, 2010
1 parent 4af0487 commit 3ea713772e17ea4e4fb17a4c410411ed8a01287f
Showing with 290 additions and 0 deletions.
  1. +17 −0 perf/README.md
  2. +7 −0 perf/conduit.html
  3. +8 −0 perf/conduit.js
  4. +24 −0 perf/index.html
  5. +154 −0 perf/jquery-1.4.2.min.js
  6. +80 −0 perf/main.js
View
@@ -0,0 +1,17 @@
+# What is this?
+
+This is some exploration around the cost of channels. How will they
+scale when hundreds of them are loaded into the same page? Here's are
+some intial questions:
+
+1. How long does it take on an average machine to initialize 100
+ channels? This includes adding iframes to the dom and establishing
+ communication with them.
+
+2. How long would it take to execute a single query across all of
+ those channels?
+
+# Running
+
+1. open index.html in your favorite modern browser
+2. press buttons
View
@@ -0,0 +1,7 @@
+<html>
+<head>
+<script src="jquery-1.4.2.min.js"></script>
+<script src="../src/jschannel.js"></script>
+<script src="conduit.js"></script>
+</head>
+</html>
View
@@ -0,0 +1,8 @@
+// get the id of this conduit:
+var id = /=(\d+)$/.exec(window.location.href)[1];
+
+var chan = Channel.build({window: window.parent, origin: "*", scope: id});
+
+chan.bind("echo", function(trans, args) {
+ return args;
+});
View
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <title>JSChannel Perf Play</title>
+ <script type="text/javascript" src="jquery-1.4.2.min.js"></script>
+ <script type="text/javascript" src="../src/jschannel.js"></script>
+</head>
+<body>
+<h1>JSChannel Performance Testing Playground</h1>
+<div id="subtitle">Just how cheap are those things?</div>
+
+<form id="buildForm"><input type="text" id="count" width="5" value="100"><button>Build em!</button></form>
+<form id="queryForm"><button>Query Em!</button></form>
+
+<div id="howMany">
+Currently you've got <span>0</span> channels running.
+</div>
+
+<pre id="outputArea"></pre>
+</body>
+<script type="text/javascript" src="main.js"></script>
+</html>
Oops, something went wrong.

0 comments on commit 3ea7137

Please sign in to comment.