test/nashorn/examples/json-parser-micro.js
author coleenp
Tue, 14 Nov 2017 10:10:05 -0500
changeset 47888 99f13d4afe85
parent 47216 71c04702a3d5
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28786
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
     1
/*
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
     2
 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
     3
 *
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
     4
 * Redistribution and use in source and binary forms, with or without
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
     5
 * modification, are permitted provided that the following conditions
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
     6
 * are met:
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
     7
 *
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
     8
 *   - Redistributions of source code must retain the above copyright
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
     9
 *     notice, this list of conditions and the following disclaimer.
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    10
 *
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    11
 *   - Redistributions in binary form must reproduce the above copyright
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    12
 *     notice, this list of conditions and the following disclaimer in the
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    13
 *     documentation and/or other materials provided with the distribution.
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    14
 *
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    15
 *   - Neither the name of Oracle nor the names of its
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    16
 *     contributors may be used to endorse or promote products derived
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    17
 *     from this software without specific prior written permission.
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    18
 *
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    19
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    20
 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    21
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    22
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    23
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    24
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    25
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    26
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    27
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    28
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    29
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    30
 */
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    31
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    32
function bench() {
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    33
    var start = Date.now();
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    34
    for (var i = 0; i < 2000; i++) {
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    35
        JSON.parse(String(json));
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    36
    }
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    37
    print("1000 iterations in", Date.now() - start, "millis");
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    38
}
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    39
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    40
var json = '[\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    41
  {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    42
    "_id": "54ca34171d3ade49782294c8",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    43
    "index": 0,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    44
    "guid": "ed0e74d5-ac63-47b6-8938-1750abab5770",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    45
    "isActive": false,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    46
    "balance": "$1,996.19",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    47
    "picture": "http://placehold.it/32x32",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    48
    "age": 39,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    49
    "eyeColor": "green",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    50
    "name": "Rose Graham",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    51
    "gender": "male",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    52
    "company": "PRIMORDIA",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    53
    "email": "rosegraham@primordia.com",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    54
    "phone": "+1 (985) 600-3551",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    55
    "address": "364 Melba Court, Succasunna, Texas, 8393",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    56
    "about": "Sunt commodo cillum occaecat velit eu eiusmod ex eiusmod sunt deserunt nulla proident incididunt. Incididunt ullamco Lorem elit do culpa esse do ex dolor aliquip labore. Ullamco velit laboris incididunt dolor. Nostrud dolor sint pariatur fugiat ullamco exercitation. Eu laboris do cupidatat eiusmod incididunt mollit occaecat voluptate.",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    57
    "registered": "2014-03-13T12:05:14 -01:00",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    58
    "latitude": 18.55665,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    59
    "longitude": 81.641001,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    60
    "tags": [\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    61
      "sint",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    62
      "Lorem",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    63
      "veniam",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    64
      "quis",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    65
      "proident",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    66
      "consectetur",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    67
      "consequat"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    68
    ],\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    69
    "friends": [\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    70
      {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    71
        "id": 0,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    72
        "name": "Evangelina Morgan"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    73
      },\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    74
      {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    75
        "id": 1,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    76
        "name": "Saunders Snyder"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    77
      },\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    78
      {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    79
        "id": 2,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    80
        "name": "Walker Wood"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    81
      }\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    82
    ],\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    83
    "greeting": "Hello, Rose Graham! You have 1 unread messages.",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    84
    "favoriteFruit": "strawberry"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    85
  },\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    86
  {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    87
    "_id": "54ca34176790c4c60fcae085",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    88
    "index": 1,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    89
    "guid": "9dc42e4c-b58f-4d92-a2ee-968d2b627d92",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    90
    "isActive": true,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    91
    "balance": "$3,832.97",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    92
    "picture": "http://placehold.it/32x32",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    93
    "age": 40,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    94
    "eyeColor": "brown",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    95
    "name": "Delaney Cherry",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    96
    "gender": "male",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    97
    "company": "INJOY",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    98
    "email": "delaneycherry@injoy.com",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
    99
    "phone": "+1 (807) 463-2295",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   100
    "address": "470 Hale Avenue, Mulberry, District Of Columbia, 5455",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   101
    "about": "Deserunt sit cupidatat elit Lorem excepteur ex. Magna officia minim cupidatat nulla enim deserunt. Amet ex in tempor commodo consequat non ad qui elit cupidatat esse labore sint.",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   102
    "registered": "2014-03-27T23:06:33 -01:00",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   103
    "latitude": -4.984238,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   104
    "longitude": 116.039285,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   105
    "tags": [\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   106
      "minim",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   107
      "velit",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   108
      "aute",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   109
      "minim",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   110
      "id",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   111
      "enim",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   112
      "enim"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   113
    ],\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   114
    "friends": [\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   115
      {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   116
        "id": 0,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   117
        "name": "Barrera Flowers"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   118
      },\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   119
      {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   120
        "id": 1,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   121
        "name": "Leann Larson"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   122
      },\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   123
      {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   124
        "id": 2,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   125
        "name": "Latoya Petty"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   126
      }\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   127
    ],\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   128
    "greeting": "Hello, Delaney Cherry! You have 2 unread messages.",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   129
    "favoriteFruit": "strawberry"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   130
  },\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   131
  {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   132
    "_id": "54ca3417920666f00c54bfc4",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   133
    "index": 2,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   134
    "guid": "f91e08f8-1598-49bc-a08b-bb48f0cc1751",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   135
    "isActive": true,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   136
    "balance": "$2,932.84",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   137
    "picture": "http://placehold.it/32x32",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   138
    "age": 28,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   139
    "eyeColor": "brown",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   140
    "name": "Mosley Hammond",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   141
    "gender": "male",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   142
    "company": "AQUACINE",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   143
    "email": "mosleyhammond@aquacine.com",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   144
    "phone": "+1 (836) 598-2591",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   145
    "address": "879 Columbia Place, Seymour, Montana, 4897",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   146
    "about": "Sunt laborum incididunt et elit in deserunt deserunt irure enim ea qui non. Minim nisi sint aute veniam reprehenderit veniam reprehenderit. Elit enim eu voluptate eu cupidatat nulla ea incididunt exercitation voluptate ut aliquip excepteur ipsum. Consequat anim fugiat irure Lorem anim consectetur est.",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   147
    "registered": "2014-07-27T05:05:58 -02:00",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   148
    "latitude": -43.608015,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   149
    "longitude": -38.33894,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   150
    "tags": [\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   151
      "proident",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   152
      "incididunt",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   153
      "eiusmod",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   154
      "anim",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   155
      "consectetur",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   156
      "qui",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   157
      "excepteur"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   158
    ],\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   159
    "friends": [\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   160
      {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   161
        "id": 0,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   162
        "name": "Hanson Davidson"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   163
      },\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   164
      {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   165
        "id": 1,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   166
        "name": "Autumn Kaufman"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   167
      },\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   168
      {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   169
        "id": 2,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   170
        "name": "Tammy Foley"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   171
      }\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   172
    ],\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   173
    "greeting": "Hello, Mosley Hammond! You have 4 unread messages.",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   174
    "favoriteFruit": "apple"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   175
  },\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   176
  {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   177
    "_id": "54ca341753b67572a2b04935",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   178
    "index": 3,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   179
    "guid": "3377416b-43a2-4f9e-ada3-2479e13b44b8",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   180
    "isActive": false,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   181
    "balance": "$3,821.54",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   182
    "picture": "http://placehold.it/32x32",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   183
    "age": 31,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   184
    "eyeColor": "green",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   185
    "name": "Mueller Barrett",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   186
    "gender": "male",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   187
    "company": "GROK",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   188
    "email": "muellerbarrett@grok.com",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   189
    "phone": "+1 (890) 535-2834",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   190
    "address": "571 Norwood Avenue, Westwood, Arkansas, 2164",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   191
    "about": "Occaecat est sunt commodo ut ex excepteur elit nulla velit minim commodo commodo esse. Lorem quis eu minim consectetur. Cupidatat cupidatat consequat sit eu ex non quis nulla veniam sint enim excepteur. Consequat minim duis do do minim fugiat minim elit laborum ut velit. Occaecat laboris veniam sint reprehenderit.",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   192
    "registered": "2014-07-18T17:15:35 -02:00",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   193
    "latitude": 10.746577,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   194
    "longitude": -160.266041,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   195
    "tags": [\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   196
      "reprehenderit",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   197
      "veniam",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   198
      "sint",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   199
      "commodo",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   200
      "exercitation",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   201
      "cillum",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   202
      "sunt"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   203
    ],\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   204
    "friends": [\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   205
      {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   206
        "id": 0,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   207
        "name": "Summers Finch"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   208
      },\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   209
      {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   210
        "id": 1,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   211
        "name": "Tracie Mcdaniel"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   212
      },\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   213
      {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   214
        "id": 2,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   215
        "name": "Ayers Patrick"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   216
      }\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   217
    ],\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   218
    "greeting": "Hello, Mueller Barrett! You have 7 unread messages.",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   219
    "favoriteFruit": "apple"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   220
  },\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   221
  {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   222
    "_id": "54ca34172775ab9615db0d1d",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   223
    "index": 4,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   224
    "guid": "a3102a3e-3f08-4df3-b5b5-62eff985d5ca",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   225
    "isActive": true,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   226
    "balance": "$3,962.27",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   227
    "picture": "http://placehold.it/32x32",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   228
    "age": 34,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   229
    "eyeColor": "green",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   230
    "name": "Patrick Foster",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   231
    "gender": "male",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   232
    "company": "QUAREX",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   233
    "email": "patrickfoster@quarex.com",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   234
    "phone": "+1 (805) 577-2362",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   235
    "address": "640 Richards Street, Roberts, American Samoa, 5530",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   236
    "about": "Aute occaecat occaecat ad eiusmod esse aliqua ullamco minim. Exercitation aute ut ex nostrud deserunt laboris officia amet enim do. Cillum officia laborum occaecat eiusmod reprehenderit ex et aliqua minim elit ex aliqua mollit. Occaecat dolor in fugiat laboris aliquip nisi ad voluptate duis eiusmod ad do.",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   237
    "registered": "2014-07-22T16:45:35 -02:00",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   238
    "latitude": 6.609025,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   239
    "longitude": -5.357026,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   240
    "tags": [\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   241
      "ea",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   242
      "ut",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   243
      "excepteur",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   244
      "enim",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   245
      "ad",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   246
      "non",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   247
      "sit"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   248
    ],\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   249
    "friends": [\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   250
      {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   251
        "id": 0,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   252
        "name": "Duncan Lewis"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   253
      },\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   254
      {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   255
        "id": 1,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   256
        "name": "Alyce Benton"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   257
      },\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   258
      {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   259
        "id": 2,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   260
        "name": "Angelique Larsen"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   261
      }\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   262
    ],\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   263
    "greeting": "Hello, Patrick Foster! You have 1 unread messages.",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   264
    "favoriteFruit": "strawberry"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   265
  },\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   266
  {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   267
    "_id": "54ca3417a190f26fef815f6d",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   268
    "index": 5,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   269
    "guid": "c09663dd-bb0e-45a4-960c-232c0e8a9486",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   270
    "isActive": false,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   271
    "balance": "$1,871.12",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   272
    "picture": "http://placehold.it/32x32",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   273
    "age": 20,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   274
    "eyeColor": "blue",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   275
    "name": "Foreman Chaney",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   276
    "gender": "male",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   277
    "company": "DEMINIMUM",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   278
    "email": "foremanchaney@deminimum.com",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   279
    "phone": "+1 (966) 523-2182",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   280
    "address": "960 Granite Street, Sunnyside, Tennessee, 1097",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   281
    "about": "Adipisicing nisi qui id sit incididunt aute exercitation veniam consequat ipsum sit irure. Aute officia commodo Lorem consequat. Labore exercitation consequat voluptate deserunt consequat do est fugiat nisi eu dolor minim id ea.",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   282
    "registered": "2015-01-21T00:18:00 -01:00",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   283
    "latitude": -69.841726,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   284
    "longitude": 121.809383,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   285
    "tags": [\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   286
      "laboris",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   287
      "sunt",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   288
      "exercitation",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   289
      "enim",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   290
      "anim",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   291
      "excepteur",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   292
      "tempor"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   293
    ],\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   294
    "friends": [\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   295
      {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   296
        "id": 0,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   297
        "name": "Espinoza Johnston"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   298
      },\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   299
      {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   300
        "id": 1,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   301
        "name": "Doreen Holder"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   302
      },\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   303
      {\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   304
        "id": 2,\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   305
        "name": "William Ellison"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   306
      }\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   307
    ],\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   308
    "greeting": "Hello, Foreman Chaney! You have 5 unread messages.",\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   309
    "favoriteFruit": "strawberry"\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   310
  }\
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   311
]';
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   312
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   313
for (var i = 0; i < 100; i++) {
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   314
    bench();
679fd2d26470 8062141: Various performance issues parsing JSON
hannesw
parents:
diff changeset
   315
}