测试克隆速度

Benchmark created on


Description

测试深克隆lodash.cloneDeep()与JSON.parse(JSON.stringify())谁的速度快

Preparation HTML

<script src="https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.21/lodash.js"></script>

Setup

const obj = {
        date: '2016-05-03',
        name: '美小团',
        province: '北京',
        city: '朝阳区',
        address: '北京市朝阳区望京东路四号',
        zip: 200333,
        tag: '家',
      }

Test runner

Ready to run.

Testing in
TestOps/sec
cloneDeep(obj)
_.cloneDeep(obj)
ready
JSON.parse(JSON.stringify(obj))
JSON.parse(JSON.stringify(obj))
ready

Revisions

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