deep cloning of objects (v9)

Revision 9 of this benchmark created by Oscar Campbell on


Description

Testing only DEEP cloning of objects. Minimum requirement is to pass 'everything that can be JSONed' test. To reduce the impact of the validation test, several runs are done in each test. /ORC

Preparation HTML

<script src="http://code.jquery.com/jquery-1.8.0.js" type="text/javascript"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.min.js"></script>
<script>var lodash = _.noConflict();</script>

<script>
function deepClone1(obj) {
  return JSON.parse(JSON.stringify(obj));
}

function deepClone2(obj) {
  var i, ret, ret2;
  if (typeof obj === "object") {
    if (obj === null) return obj;
    if (Object.prototype.toString.call(obj) === "[object Array]") {
      ret = [];
      for (i = 0; i < obj.length; i++) {
        if (typeof obj[i] === "object") {
          ret2 = deepClone2(obj[i]);
        } else {
          ret2 = obj[i];
        }
        ret.push(ret2);
      }
    } else {
      ret = {};
      for (i in obj) {
        if (obj.hasOwnProperty(i)) {
          if (typeof(obj[i] === "object")) {
            ret2 = deepClone2(obj[i]);
          } else {
            ret2 = obj[i];
          }
          ret[i] = ret2;
        }
      }
    }
  } else {
    ret = obj;
  }

  return ret;
}

// comes from: http://jsperf.com/cloning-an-object/23
function deepClone3(obj) {
    var target = {};
    for (var i in obj) {
      if (typeof(obj) === 'object') {
        target[i] = deepClone3(obj[i]);
      }
      else {
        target[i] = obj[i];
      }
    }
    return target;
  }

// adapted from: http://jsperf.com/cloning-an-object/23
function deepClone4(obj) {
   return lodash.clone(obj, /*deep=*/true);
}

// adapted from: http://jsperf.com/cloning-an-object/23
function deepClone5(obj) {
   return jQuery.extend(/*deep=*/true, {}, obj);
}

// comes from: http://jsperf.com/cloning-an-object/23
function deepClone6(obj) {
   return Object.clone(obj);
}

// adapted/reduced from: http://jsperf.com/structured-clone-objects/2 and https://developer.mozilla.org/en-US/docs/DOM/The_structured_clone_algorithm
function deepClone7(oToBeCloned) {
  if (oToBeCloned === null || !(oToBeCloned instanceof Object)) { return oToBeCloned; }
  var oClone, fConstr = oToBeCloned.constructor;
  oClone = new fConstr();
  for (var sProp in oToBeCloned) { oClone[sProp] = deepClone7(oToBeCloned[sProp]); }
  return oClone;
};


// ******************

// comes from: http://jsperf.com/cloning-an-object/23
  Object.defineProperties(Object, {
    'extend': {
      'configurable': true,
      'enumerable': false,
      'value': function extend(what, wit) {
        var extObj, witKeys = Object.keys(wit);

        extObj = Object.keys(what).length ? Object.clone(what) : {};

        witKeys.forEach(function(key) {
          Object.defineProperty(extObj, key, Object.getOwnPropertyDescriptor(wit, key));
        });

        return extObj;
      },
      'writable': true
    },
    'clone': {
      'configurable': true,
      'enumerable': false,
      'value': function clone(obj) {
        return Object.extend({}, obj);
      },
      'writable': true
    }
  });

// ******************

// ensure that the deep-clone is actually accurate
function compareObjs(obj1, obj2) {
  // snapshot how `obj1` currently looks
  var orig = JSON.stringify(obj1);

  // test if `obj2` really was a clone of `obj1`
  if (orig !== JSON.stringify(obj2)) {
    throw new Error("failed test 1");
  }

  // do some mutations to `obj2` clone
  obj2[0].firstName = "3";
  // check that `obj1` wasn't affected
  if (orig !== JSON.stringify(obj1)) {
    throw new Error("failed test 2");
  }
}



// Generated by LiveScript 1.2.0
(function(){
  var __toString;
  deepClone8 = function(obj, recurseSafe){
    recurseSafe == null && (recurseSafe = false);
    if (typeof obj !== 'object') {
      return obj;
    } else if (recurseSafe) {
      return _createRecurseSafeCpoInner()(obj);
    } else {
      return _nonRecurseSafeCpoInner(obj);
    }
  };
  __toString = {}.toString;
  function _nonRecurseSafeCpoInner(obj){
    var reto, k, v, len, i$, i, ref$, typestr, own$ = {}.hasOwnProperty;
    if (obj === null) {
      return null;
    }
    if (obj.prototype === Object) {
      reto = {};
      for (k in obj) if (own$.call(obj, k)) {
        v = obj[k];
        reto[k] = typeof v === 'object' ? _nonRecurseSafeCpoInner(v) : v;
      }
      return reto;
    }
    if (obj.prototype === Array || (typeof obj.unshift !== 'undefined' && __toString.call(obj) === '[object Array]')) {
      reto = new Array(len = obj.length);
      for (i$ = 0; i$ < len; ++i$) {
        i = i$;
        v = obj[i];
        reto[i] = typeof v === 'object' ? _nonRecurseSafeCpoInner(v) : v;
      }
      return reto;
    }
    if ((ref$ = obj.prototype) === Date || ref$ === RegExp) {
      return obj;
    }
    if (typeof obj.exec !== 'undefined' || typeof obj.getYear !== 'undefined') {
      typestr = __toString.call(obj);
      if (typestr === '[object RegExp]' || typestr === '[object Date]') {
        return obj;
      }
    }
    if (__toString.call(obj === '[object Object]')) {
      reto = {};
      for (k in obj) if (own$.call(obj, k)) {
        v = obj[k];
        reto[k] = typeof v === 'object' ? _nonRecurseSafeCpoInner(v) : v;
      }
      return reto;
    }
    return obj;
  }
  function _createRecurseSafeCpoInner(){
    var __toString, seen, mapArr, _cpo_inner;
    __toString = {}.toString;
    seen = [];
    mapArr = [];
    _cpo_inner = function(obj){
      var i, reto, len, i$, v, foundAnObj, ref$, typestr, k, own$ = {}.hasOwnProperty;
      if ((i = seen.indexOf(obj)) !== -1) {
        return mapArr[i];
      }
      if (obj === null) {
        return null;
      }
      if (obj.prototype === Array || (typeof obj.unshift !== 'undefined' && __toString.call(obj) === '[object Array]')) {
        reto = new Array(len = obj.length);
        mapArr.push(reto);
        seen.push(obj);
        for (i$ = 0; i$ < len; ++i$) {
          i = i$;
          v = obj[i];
          reto[i] = typeof v === 'object' ? _cpo_inner(v) : v;
        }
        return reto;
      }
      foundAnObj = obj.prototype === Object;
      if (!foundAnObj) {
        if ((ref$ = obj.prototype) === Date || ref$ === RegExp) {
          return obj;
        }
        if (typeof obj.exec !== 'undefined' || typeof obj.getYear !== 'undefined') {
          typestr = __toString.call(obj);
          if (typestr === '[object RegExp]' || typestr === '[object Date]') {
            return obj;
          }
        }
      }
      if (foundAnObj || __toString.call(obj === '[object Object]')) {
        reto = {};
        mapArr.push(reto);
        seen.push(obj);
        for (k in obj) if (own$.call(obj, k)) {
          v = obj[k];
          reto[k] = typeof v === 'object' ? _cpo_inner(v) : v;
        }
        return reto;
      }
      return obj;
    };
    return _cpo_inner;
  }
}.call(this));












(function(){
    var __toString = {}.toString
        , own$ = {}.hasOwnProperty
        , isArrFallback = Array.isArray || function(obj) {
                return typeof obj.unshift !== 'undefined' && __toString.call(obj) === '[object Array]';
        }
        , chickenOutCounter
        , chickenOutLimit
        , nop = function(){}
        , recurser = _nonRecurseSafeCpoInner
        //, friendPrototypesObj = []
        //, friendPrototypesArr = []
        ;

    deepCloneA = function(obj) {
        if (typeof obj !== 'object') {
            return obj;
        } else {
            return _CpoInnerNoSafetyBelt(obj);
        }
    };

    function _CpoInnerNoSafetyBelt(obj) {
        if (obj === null) return null;
        var ctor = obj.constructor;

        if (ctor === Object) {
            var k, v, reto = {};
            for (k in obj) if (own$.call(obj, k)) {
                v = obj[k];
                reto[k] = typeof v === 'object' ? _CpoInnerNoSafetyBelt(v) : v;
            }
            return reto;
        }
        if (ctor === Array || isArrFallback(obj)) {
            var i, v, len = obj.length, reto = new Array(len);
            for (i = 0; i < len; ++i) {
                v = obj[i];
                reto[i] = typeof v === 'object' ? _CpoInnerNoSafetyBelt(v) : v;
            }
            return reto;
        }
        if (ctor === Date || ctor === RegExp) {
            return obj;
        }
        if (typeof obj.exec !== 'undefined' || typeof obj.getYear !== 'undefined') {
            var typestr = __toString.call(obj);
            if (typestr === '[object RegExp]' || typestr === '[object Date]') {
                return obj;
            }
        }
        if (__toString.call(obj === '[object Object]')) {
            //dbgFallbackObj++;
            console.log('isObj-FALLBACK', ctor);
            //friendPrototypesObj.push(ctor);
            var k, v, reto = {};
            for (k in obj) if (own$.call(obj, k)) {
                v = obj[k];
                reto[k] = typeof v === 'object' ? _CpoInnerNoSafetyBelt(v) : v;
            }
            return reto;
        }
        return obj;
    }


    /*u.cpo*/
    deepClone9 = function(obj, recurseSafe) {
        recurseSafe == null && (recurseSafe = 0);
        if (typeof obj !== 'object') {
            //console.log('top level value was not an object', obj);
            return obj;
        } else if (recurseSafe === true) {
            //console.log('Runs recurse ref safe version');
            return _createRecurseSafeCpoInner()(obj);
        } else {
            //console.log('Runs fast version with safety belt');
            chickenOutCounter = 0;
            chickenOutLimit = typeof recurseSafe === 'number' ? recurseSafe : 10000;
            out = recurser(obj);

            //console.log('chickenout-counter is', chickenOutCounter, chickenOutLimit);
            //console.log('ctorarray', dbgArrayCountCtor, 'dynctorarray', dbgArrayCountDynCtor, 'fallbakarr', dbgFallbackArray)
            //console.log('ctorobj', dbgObjCountCtor, 'dynctorobj', dbgObjCountDynCtor, 'fallbakobj', dbgFallbackObj)

            if (recurser === nop) {
                //console.log('safety belt caught us - run again with recurse-ref safe version');
                //IS_DEV && _E('FALLS BACK TO RECURSIVE-REFERENCES SAFE DEEPCOPY!!!');
                recurser = _nonRecurseSafeCpoInner;
                out = _createRecurseSafeCpoInner()(obj);
            }

            return out;
        }
    };


    //var dbgObjCountCtor = 0, dbgObjCountDynCtor = 0, dbgFallbackObj = 0;
    //var dbgArrayCountCtor = 0, dbgArrayCountDynCtor = 0, dbgFallbackArray = 0;

    function _nonRecurseSafeCpoInner(obj) {
        if (++chickenOutCounter > chickenOutLimit) {
            //console.log("DAMN! We chickened out!");
            recurser = nop;
            return null;
        }

        if (obj === null) return null;
        var ctor = obj.constructor;

        //if (ctor === Object || friendPrototypesObj.indexOf(ctor ) != -1) {
        if (ctor === Object) {
            //dbgObjCountCtor++;
            var k, v, reto = {};
            for (k in obj) if (own$.call(obj, k)) {
                v = obj[k];
                reto[k] = typeof v === 'object' ? recurser(v) : v;
            }
            return reto;
        }
        var isAnArray = false;
        if (ctor === Array) {
            //dbgArrayCountCtor++;
            isAnArray = true;
        //} else if (friendPrototypesArr.indexOf(ctor) != -1) {
        //    dbgArrayCountDynCtor++;
        //    isAnArray = true;
        } else if (isArrFallback(obj)) {
            isAnArray = true;
            //friendPrototypesArr.push(ctor);
        }
        if (isAnArray) {
            //console.log('isArr');
            var i, v, len = obj.length, reto = new Array(len);
            for (i = 0; i < len; ++i) {
                v = obj[i];
                reto[i] = typeof v === 'object' ? recurser(v) : v;
            }
            return reto;
        }
        if (ctor === Date || ctor === RegExp) {
            return obj;
        }
        if (typeof obj.exec !== 'undefined' || typeof obj.getYear !== 'undefined') {
            var typestr = __toString.call(obj);
            if (typestr === '[object RegExp]' || typestr === '[object Date]') {
                return obj;
            }
        }
        if (__toString.call(obj === '[object Object]')) {
            //dbgFallbackObj++;
            console.log('isObj-FALLBACK', ctor);
            //friendPrototypesObj.push(ctor);
            var k, v, reto = {};
            for (k in obj) if (own$.call(obj, k)) {
                v = obj[k];
                reto[k] = typeof v === 'object' ? recurser(v) : v;
            }
            return reto;
        }
        return obj;
    }



    function _createRecurseSafeCpoInner() {
        var __toString= {}.toString
            , seen = []
            , mapArr = [];

        var _cpo_inner = function(obj){
            var i;

            if ((i = seen.indexOf(obj)) !== -1) {
                return mapArr[i];
            }
            if (obj === null) {
                return null;
            }
            var ctor = obj.constructor;
            if (ctor === Array || isArrFallback(obj)) {
                var v, len = obj.length, reto = new Array(len);
                mapArr.push(reto);
                seen.push(obj);
                for (i = 0; i < len; ++i) {
                    v = obj[i];
                    reto[i] = typeof v === 'object' ? _cpo_inner(v) : v;
                }
                return reto;
            }
            var foundAnObj = (ctor === Object);
            if (!foundAnObj) {
                if (ctor === Date || ctor === RegExp) {
                    return obj;
                }
                if (typeof obj.exec !== 'undefined' || typeof obj.getYear !== 'undefined') {
                    var typestr = __toString.call(obj);
                    if (typestr === '[object RegExp]' || typestr === '[object Date]') {
                        return obj;
                    }
                }
            }
            if (foundAnObj || __toString.call(obj === '[object Object]')) {
                var k, v, reto = {};
                mapArr.push(reto);
                seen.push(obj);
                for (k in obj) if (own$.call(obj, k)) {
                    v = obj[k];
                    reto[k] = typeof v === 'object' ? _cpo_inner(v) : v;
                }
                return reto;
            }
            return obj;
        };
        return _cpo_inner;
    }
}.call(this));




</script>

Setup

var a = [
      {id: 1, name: {first: 'Joe', last: 'Fabiano'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Joe.Fabiano@ex.com'},
      {id: 2, name: {first: 'Fred', last: 'Wecler'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Fred.Wecler@ex.com'},
      {id: 3, name: {first: 'Steve', last: 'Wilson'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Steve.Wilson@ex.com'},
      {id: 4, name: {first: 'Maria', last: 'Fernandez'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'M.Fernandez@ex.com'},
      {id: 5, name: {first: 'Pierre', last: 'Barbault'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Pierre.Barbault@ex.com'},
      {id: 6, name: {first: 'Nancy', last: 'Moore'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Nancy.Moore@ex.com'},
      {id: 7, name: {first: 'Barbara', last: 'MacDonald'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'B.MacDonald@ex.com'},
      {id: 8, name: {first: 'Wilma', last: 'Williams'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Wilma.Williams@ex.com'},
      {id: 9, name: {first: 'Sasha', last: 'Silver'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Sasha.Silver@ex.com'},
      {id: 10, name: {first: 'Don', last: 'Pérignon'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Don.Pérignon@ex.com'},
      {id: 11, name: {first: 'Aaron', last: 'Kinley'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Aaron.Kinley@ex.com'},
      {id: 2, name: {first: 'Fred', last: 'Wecler'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Fred.Wecler@ex.com'},
      {id: 3, name: {first: 'Steve', last: 'Wilson'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Steve.Wilson@ex.com'},
      {id: 4, name: {first: 'Maria', last: 'Fernandez'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'M.Fernandez@ex.com'},
      {id: 5, name: {first: 'Pierre', last: 'Barbault'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Pierre.Barbault@ex.com'},
      {id: 6, name: {first: 'Nancy', last: 'Moore'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Nancy.Moore@ex.com'},
      {id: 7, name: {first: 'Barbara', last: 'MacDonald'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'B.MacDonald@ex.com'},
      {id: 8, name: {first: 'Wilma', last: 'Williams'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Wilma.Williams@ex.com'},
      {id: 9, name: {first: 'Sasha', last: 'Silver'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Sasha.Silver@ex.com'},
      {id: 10, name: {first: 'Don', last: 'Pérignon'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Don.Pérignon@ex.com'},
      {id: 11, name: {first: 'Aaron', last: 'Kinley'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Aaron.Kinley@ex.com'},
      {id: 2, name: {first: 'Fred', last: 'Wecler'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Fred.Wecler@ex.com'},
      {id: 3, name: {first: 'Steve', last: 'Wilson'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Steve.Wilson@ex.com'},
      {id: 4, name: {first: 'Maria', last: 'Fernandez'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'M.Fernandez@ex.com'},
      {id: 5, name: {first: 'Pierre', last: 'Barbault'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Pierre.Barbault@ex.com'},
      {id: 6, name: {first: 'Nancy', last: 'Moore'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Nancy.Moore@ex.com'},
      {id: 7, name: {first: 'Barbara', last: 'MacDonald'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'B.MacDonald@ex.com'},
      {id: 8, name: {first: 'Wilma', last: 'Williams'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Wilma.Williams@ex.com'},
      {id: 9, name: {first: 'Sasha', last: 'Silver'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Sasha.Silver@ex.com'},
      {id: 10, name: {first: 'Don', last: 'Pérignon'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Don.Pérignon@ex.com'},
      {id: 11, name: {first: 'Aaron', last: 'Kinley'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Aaron.Kinley@ex.com'},
      {id: 2, name: {first: 'Fred', last: 'Wecler'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Fred.Wecler@ex.com'},
      {id: 3, name: {first: 'Steve', last: 'Wilson'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Steve.Wilson@ex.com'},
      {id: 4, name: {first: 'Maria', last: 'Fernandez'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'M.Fernandez@ex.com'},
      {id: 5, name: {first: 'Pierre', last: 'Barbault'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Pierre.Barbault@ex.com'},
      {id: 6, name: {first: 'Nancy', last: 'Moore'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Nancy.Moore@ex.com'},
      {id: 7, name: {first: 'Barbara', last: 'MacDonald'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'B.MacDonald@ex.com'},
      {id: 8, name: {first: 'Wilma', last: 'Williams'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Wilma.Williams@ex.com'},
      {id: 9, name: {first: 'Sasha', last: 'Silver'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Sasha.Silver@ex.com'},
      {id: 10, name: {first: 'Don', last: 'Pérignon'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Don.Pérignon@ex.com'},
      {id: 11, name: {first: 'Aaron', last: 'Kinley'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Aaron.Kinley@ex.com'},
      {id: 2, name: {first: 'Fred', last: 'Wecler'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Fred.Wecler@ex.com'},
      {id: 3, name: {first: 'Steve', last: 'Wilson'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Steve.Wilson@ex.com'},
      {id: 4, name: {first: 'Maria', last: 'Fernandez'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'M.Fernandez@ex.com'},
      {id: 5, name: {first: 'Pierre', last: 'Barbault'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Pierre.Barbault@ex.com'},
      {id: 6, name: {first: 'Nancy', last: 'Moore'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Nancy.Moore@ex.com'},
      {id: 7, name: {first: 'Barbara', last: 'MacDonald'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'B.MacDonald@ex.com'},
      {id: 8, name: {first: 'Wilma', last: 'Williams'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Wilma.Williams@ex.com'},
      {id: 9, name: {first: 'Sasha', last: 'Silver'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Sasha.Silver@ex.com'},
      {id: 10, name: {first: 'Don', last: 'Pérignon'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Don.Pérignon@ex.com'},
      {id: 11, name: {first: 'Aaron', last: 'Kinley'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Aaron.Kinley@ex.com'},
      {id: 2, name: {first: 'Fred', last: 'Wecler'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Fred.Wecler@ex.com'},
      {id: 3, name: {first: 'Steve', last: 'Wilson'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Steve.Wilson@ex.com'},
      {id: 4, name: {first: 'Maria', last: 'Fernandez'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'M.Fernandez@ex.com'},
      {id: 5, name: {first: 'Pierre', last: 'Barbault'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Pierre.Barbault@ex.com'},
      {id: 6, name: {first: 'Nancy', last: 'Moore'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Nancy.Moore@ex.com'},
      {id: 7, name: {first: 'Barbara', last: 'MacDonald'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'B.MacDonald@ex.com'},
      {id: 8, name: {first: 'Wilma', last: 'Williams'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Wilma.Williams@ex.com'},
      {id: 9, name: {first: 'Sasha', last: 'Silver'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Sasha.Silver@ex.com'},
      {id: 10, name: {first: 'Don', last: 'Pérignon'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Don.Pérignon@ex.com'},
      {id: 11, name: {first: 'Aaron', last: 'Kinley'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Aaron.Kinley@ex.com'},
      {id: 2, name: {first: 'Fred', last: 'Wecler'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Fred.Wecler@ex.com'},
      {id: 3, name: {first: 'Steve', last: 'Wilson'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Steve.Wilson@ex.com'},
      {id: 4, name: {first: 'Maria', last: 'Fernandez'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'M.Fernandez@ex.com'},
      {id: 5, name: {first: 'Pierre', last: 'Barbault'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Pierre.Barbault@ex.com'},
      {id: 6, name: {first: 'Nancy', last: 'Moore'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Nancy.Moore@ex.com'},
      {id: 7, name: {first: 'Barbara', last: 'MacDonald'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'B.MacDonald@ex.com'},
      {id: 8, name: {first: 'Wilma', last: 'Williams'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Wilma.Williams@ex.com'},
      {id: 9, name: {first: 'Sasha', last: 'Silver'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Sasha.Silver@ex.com'},
      {id: 10, name: {first: 'Don', last: 'Pérignon'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Don.Pérignon@ex.com'},
      {id: 11, name: {first: 'Aaron', last: 'Kinley'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Aaron.Kinley@ex.com'},
      {id: 2, name: {first: 'Fred', last: 'Wecler'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Fred.Wecler@ex.com'},
      {id: 3, name: {first: 'Steve', last: 'Wilson'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Steve.Wilson@ex.com'},
      {id: 4, name: {first: 'Maria', last: 'Fernandez'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'M.Fernandez@ex.com'},
      {id: 5, name: {first: 'Pierre', last: 'Barbault'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Pierre.Barbault@ex.com'},
      {id: 6, name: {first: 'Nancy', last: 'Moore'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Nancy.Moore@ex.com'},
      {id: 7, name: {first: 'Barbara', last: 'MacDonald'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'B.MacDonald@ex.com'},
      {id: 8, name: {first: 'Wilma', last: 'Williams'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Wilma.Williams@ex.com'},
      {id: 9, name: {first: 'Sasha', last: 'Silver'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Sasha.Silver@ex.com'},
      {id: 10, name: {first: 'Don', last: 'Pérignon'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Don.Pérignon@ex.com'},
      {id: 11, name: {first: 'Aaron', last: 'Kinley'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Aaron.Kinley@ex.com'},
      {id: 2, name: {first: 'Fred', last: 'Wecler'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Fred.Wecler@ex.com'},
      {id: 3, name: {first: 'Steve', last: 'Wilson'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Steve.Wilson@ex.com'},
      {id: 4, name: {first: 'Maria', last: 'Fernandez'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'M.Fernandez@ex.com'},
      {id: 5, name: {first: 'Pierre', last: 'Barbault'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Pierre.Barbault@ex.com'},
      {id: 6, name: {first: 'Nancy', last: 'Moore'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Nancy.Moore@ex.com'},
      {id: 7, name: {first: 'Barbara', last: 'MacDonald'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'B.MacDonald@ex.com'},
      {id: 8, name: {first: 'Wilma', last: 'Williams'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Wilma.Williams@ex.com'},
      {id: 9, name: {first: 'Sasha', last: 'Silver'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Sasha.Silver@ex.com'},
      {id: 10, name: {first: 'Don', last: 'Pérignon'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Don.Pérignon@ex.com'},
      {id: 11, name: {first: 'Aaron', last: 'Kinley'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Aaron.Kinley@ex.com'},
      {id: 2, name: {first: 'Fred', last: 'Wecler'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Fred.Wecler@ex.com'},
      {id: 3, name: {first: 'Steve', last: 'Wilson'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Steve.Wilson@ex.com'},
      {id: 4, name: {first: 'Maria', last: 'Fernandez'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'M.Fernandez@ex.com'},
      {id: 5, name: {first: 'Pierre', last: 'Barbault'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Pierre.Barbault@ex.com'},
      {id: 6, name: {first: 'Nancy', last: 'Moore'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Nancy.Moore@ex.com'},
      {id: 7, name: {first: 'Barbara', last: 'MacDonald'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'B.MacDonald@ex.com'},
      {id: 8, name: {first: 'Wilma', last: 'Williams'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Wilma.Williams@ex.com'},
      {id: 9, name: {first: 'Sasha', last: 'Silver'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Sasha.Silver@ex.com'},
      {id: 10, name: {first: 'Don', last: 'Pérignon'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Don.Pérignon@ex.com'},
      {id: 11, name: {first: 'Aaron', last: 'Kinley'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Aaron.Kinley@ex.com'},
      {id: 2, name: {first: 'Fred', last: 'Wecler'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Fred.Wecler@ex.com'},
      {id: 3, name: {first: 'Steve', last: 'Wilson'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Steve.Wilson@ex.com'},
      {id: 4, name: {first: 'Maria', last: 'Fernandez'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'M.Fernandez@ex.com'},
      {id: 5, name: {first: 'Pierre', last: 'Barbault'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Pierre.Barbault@ex.com'},
      {id: 6, name: {first: 'Nancy', last: 'Moore'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Nancy.Moore@ex.com'},
      {id: 7, name: {first: 'Barbara', last: 'MacDonald'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'B.MacDonald@ex.com'},
      {id: 8, name: {first: 'Wilma', last: 'Williams'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Wilma.Williams@ex.com'},
      {id: 9, name: {first: 'Sasha', last: 'Silver'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Sasha.Silver@ex.com'},
      {id: 10, name: {first: 'Don', last: 'Pérignon'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Don.Pérignon@ex.com'},
      {id: 11, name: {first: 'Aaron', last: 'Kinley'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Aaron.Kinley@ex.com'},
      {id: 2, name: {first: 'Fred', last: 'Wecler'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Fred.Wecler@ex.com'},
      {id: 3, name: {first: 'Steve', last: 'Wilson'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Steve.Wilson@ex.com'},
      {id: 4, name: {first: 'Maria', last: 'Fernandez'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'M.Fernandez@ex.com'},
      {id: 5, name: {first: 'Pierre', last: 'Barbault'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Pierre.Barbault@ex.com'},
      {id: 6, name: {first: 'Nancy', last: 'Moore'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Nancy.Moore@ex.com'},
      {id: 7, name: {first: 'Barbara', last: 'MacDonald'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'B.MacDonald@ex.com'},
      {id: 8, name: {first: 'Wilma', last: 'Williams'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Wilma.Williams@ex.com'},
      {id: 9, name: {first: 'Sasha', last: 'Silver'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Sasha.Silver@ex.com'},
      {id: 10, name: {first: 'Don', last: 'Pérignon'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Don.Pérignon@ex.com'},
      {id: 11, name: {first: 'Aaron', last: 'Kinley'}, children: [{first: 'Bubba', last: 'Leatherchest'}, {first: 'Tux', last: 'Sysop', toys: ['Linux', 'JS-Perf', 'Machine Guns']}], ip: '0.0.0.1', email: 'Aaron.Kinley@ex.com'}
    ];

Test runner

Ready to run.

Testing in
TestOps/sec
deepClone1 (JSON parse/stringify)
deepClone1(a);
deepClone1(a);
deepClone1(a);
deepClone1(a);
compareObjs(a, deepClone1(a));
ready
deepClone2 (full obj deep clone)
deepClone2(a);
deepClone2(a);
deepClone2(a);
deepClone2(a);
compareObjs(a, deepClone2(a));
ready
deepClone7 (structured clone)
// adapted/reduced from: http://jsperf.com/structured-clone-objects/2 
// and https://developer.mozilla.org/en-US/docs/DOM/The_structured_clone_algorithm

deepClone7(a);
deepClone7(a);
deepClone7(a);
deepClone7(a);
compareObjs(a, deepClone7(a));
ready
deepClone8 - reference-recursion-safe = false
// Aside from deepClone1, and others, it handles Function, 
// Date, RegExp - properties / objects fine too. /ORC

deepClone8(a, false);
deepClone8(a, false);
deepClone8(a, false);
deepClone8(a, false);
compareObjs(a, deepClone8(a, false));
ready
deepClone8 - reference-recursion-safe = true
// Aside from deepClone1, and others, it handles Function, 
// Date, RegExp - properties / objects fine too. /ORC
// In this mode it also makes sure to not follow recursive references,
// instead returning the copy made, thereby even cloning the 
// inner-object recursion. /ORC

deepClone8(a, true);
deepClone8(a, true);
deepClone8(a, true);
deepClone8(a, true);
compareObjs(a, deepClone8(a, true));
 
ready
deepClone9 high fallback threshold
// Aside from deepClone1, and others, it handles Function, 
// Date, RegExp - properties / objects fine too. /ORC
// In this mode it has a count of object divings - if it gets
// above chosen threshold - it aborts and falls back to using
// the 'Recursive References Objects'-safe version and then 
// makes sure to not follow recursive references,
// instead returning the copy made, thereby even cloning the 
// inner-object recursion. /ORC

deepClone9(a, 1000000);
deepClone9(a, 1000000);
deepClone9(a, 1000000);
deepClone9(a, 1000000);
compareObjs(a, deepClone9(a, 1000000));
 
ready
deepClone9 low fallback threshold
// Aside from deepClone1, and others, it handles Function, 
// Date, RegExp - properties / objects fine too. /ORC
// In this mode it has a count of object divings - if it gets
// above chosen threshold - it aborts and falls back to using
// the 'Recursive References Objects'-safe version and then 
// makes sure to not follow recursive references,
// instead returning the copy made, thereby even cloning the 
// inner-object recursion. /ORC
// The current test material has 700 objects in it - so 699 
// will be a WORST CASE SCENARIO for the safety belt fallback. 
deepClone9(a, 699);
deepClone9(a, 699);
deepClone9(a, 699);
deepClone9(a, 699);
compareObjs(a, deepClone9(a, 699));
 
ready
deepCloneA
// Similar to deepClone8(false) - shaved some corners.
// Aside from deepClone1, and others, it handles Function, 
// Date, RegExp - properties / objects fine too. /ORC

deepCloneA(a, false);
deepCloneA(a, false);
deepCloneA(a, false);
deepCloneA(a, false);
compareObjs(a, deepCloneA(a, false));
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 1: published by Kyle Simpson on
  • Revision 2: published by Bernie on
  • Revision 3: published by derry on
  • Revision 4: published by Marcin on
  • Revision 5: published by Marcin on
  • Revision 9: published by Oscar Campbell on
  • Revision 10: published by Oscar Campbell on
  • Revision 11: published on
  • Revision 12: published by Oscar Campbell on
  • Revision 28: published by cari bisnis rumahan sampingan on
  • Revision 29: published by cari modal usaha on
  • Revision 31: published on