Skip to content

Commit

Permalink
removed old node querystring stuff from benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Jul 19, 2011
1 parent 147d139 commit 78856e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 deletions.
27 changes: 6 additions & 21 deletions benchmark.js
@@ -1,32 +1,17 @@

var old = require('querystring')
, qs = require('./')
, times = 100000;
var qs = require('./');

var start = new Date
, n = times;

while (n--) old.parse('foo=bar');
console.log('old simple: %dms', new Date - start);

var start = new Date
var times = 100000
, start = new Date
, n = times;

while (n--) old.parse('user[name][first]=tj&user[name][last]=holowaychuk');
console.log('old nested: %dms', new Date - start);


console.log();


var start = new Date
, n = times;
console.log('times: %d', times);

while (n--) qs.parse('foo=bar');
console.log('new simple: %dms', new Date - start);
console.log('simple: %dms', new Date - start);

var start = new Date
, n = times;

while (n--) qs.parse('user[name][first]=tj&user[name][last]=holowaychuk');
console.log('new nested: %dms', new Date - start);
console.log('nested: %dms', new Date - start);
2 changes: 1 addition & 1 deletion examples.js
Expand Up @@ -36,4 +36,4 @@ var obj = qs.parse('user[names]=tj&user[names]=TJ&user[names]=Tyler');
console.log(obj)

var obj = qs.parse('user[name][first]=tj&user[name][first]=TJ');
console.log(obj)
console.log(obj)

0 comments on commit 78856e1

Please sign in to comment.