Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // * * * * * * * * * * * * * * * * *
- // Activation object Arguments scope
- // * * * * * * * * * * * * * * * * *
- (function (a, dt, index, i, c, r, t, res) {
- r = [];
- c = a.length;
- dt = new Date();
- index = 20000;
- while (index--) {
- a.map(function (t) { return t * t}).filter(function (t) { return t > 5});
- }
- r[0] = (new Date() - dt);
- dt = new Date();
- index = 20000;
- while (index--) {
- for (i = 0, res = []; i < c; i++) {
- t = a[i];
- if (t >= 2.236067) {
- continue;
- } else {
- res.push(t * t);
- }
- }
- }
- r[1] = (new Date() - dt);
- alert('ao args: ' + r);
- }([1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10]));
- // * * * * * * * * * * * * * * * * *
- // Activation object scope
- // * * * * * * * * * * * * * * * * *
- (function () {
- var a = [1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10],
- dt,
- index,
- i,
- c,
- r,
- t,
- res
- ;
- r = [];
- c = a.length;
- dt = new Date();
- index = 20000;
- while (index--) {
- a.map(function (t) { return t * t}).filter(function (t) { return t > 5});
- }
- r[0] = (new Date() - dt);
- dt = new Date();
- index = 20000;
- while (index--) {
- for (i = 0, res = []; i < c; i++) {
- t = a[i];
- if (t >= 2.236067) {
- continue;
- } else {
- res.push(t * t);
- }
- }
- }
- r[1] = (new Date() - dt);
- alert('ao: ' + r);
- }());
- // * * * * * * * * * * * * * * * * *
- // Global scope
- // * * * * * * * * * * * * * * * * *
- var a = [1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10],
- dt,
- index,
- i,
- c,
- r,
- t,
- res
- ;
- r = [];
- c = a.length;
- dt = new Date();
- index = 20000;
- while (index--) {
- a.map(function (t) { return t * t}).filter(function (t) { return t > 5});
- }
- r[0] = (new Date() - dt);
- dt = new Date();
- index = 20000;
- while (index--) {
- for (i = 0, res = []; i < c; i++) {
- t = a[i];
- if (t >= 2.236067) {
- continue;
- } else {
- res.push(t * t);
- }
- }
- }
- r[1] = (new Date() - dt);
- alert('global: ' + r);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement