Lodash vs JSON

Benchmark created by Sergiy Voznyak on


Preparation HTML

<script src="https://cdn.jsdelivr.net/lodash/4.17.4/lodash.min.js"></script>

Setup

var x = {
    "createTemplate": false,
    "itemShippingOptions": [
      {
        "shippingMethodId": 2,
        "firstPackagePrice": 0,
        "nextPackagePrice": 0,
        "freeOfCharge": false,
        "packageQuantity": 1
      }
    ],
    "userId": 10970152,
    "itemQuantityTypeEnumId": 3,
    "itemDurationEnumId": 3,
    "itemShipmentPayerEnumId": 2,
    "itemName": "Test nabidka with images",
    "categoryId": 48777,
    "itemAttributeValues": [
      {
        "attributeValue": "1",
        "itemAttributeId": 93,
        "itemAttributeValueId": 745
      }
    ],
    "images": [
      {
        "url": "9e192b6b-cb35-433b-a0bb-ba90868b2be2",
        "titleImage": true
      },
      {
        "url": "4b9416c2-d08d-44f0-89d5-612802d618db",
        "titleImage": true
      }
    ],
    "itemTypeEnumId": 1,
    "startingQuantity": 1,
    "buyNowPrice": 500,
    "shipmentPaymentDescription": "test test test",
    "paymentBankTransfer": true
  };

Test runner

Ready to run.

Testing in
TestOps/sec
JSON
var ergebnis = JSON.parse(JSON.stringify(x))
ready
Lodash
var ergebnis = _.cloneDeep(x);
ready

Revisions

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

  • Revision 1: published by Sergiy Voznyak on