Skip to content

Instantly share code, notes, and snippets.

@heapwolf
Created January 2, 2012 04:21
Show Gist options
  • Save heapwolf/1549335 to your computer and use it in GitHub Desktop.
Save heapwolf/1549335 to your computer and use it in GitHub Desktop.
Math.abs() performance
var test = require('testling');
test('Math.abs performance', function (t) {
var t0 = new Date;
for (var i = 0; i < 100 * 1000; i++) Math.abs(i - 50 * 1000)
t.log(new Date - t0);
t.end();
});
$ curl -u substack@gmail.com -sSNT abs.js testling.com
Enter host password for user 'substack@gmail.com':
Bundling... done
iexplore/7.0 0/0 0 % ok
Log: 3000
iexplore/8.0 0/0 0 % ok
Log: 1578
iexplore/9.0 0/0 0 % ok
Log: 365
chrome/15.0 0/0 0 % ok
Log: 57
firefox/7.0 0/0 0 % ok
Log: 158
opera/11.5 0/0 0 % ok
Log: 166
safari/5.1 0/0 0 % ok
Log: 176
total 0/0 0 % ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment