{"ScriptPreparationCode":"var shapes = [];\r\n\r\nfor ( let i = 0; i \u003C 100; i\u002B\u002B ) {\r\n shapes.push( {\r\n position: { x: Math.random(), y: Math.random() },\r\n width: Math.random(),\r\n height: Math.random(),\r\n points: [\r\n { x: Math.random(), y: Math.random() },\r\n { x: Math.random(), y: Math.random() },\r\n { x: Math.random(), y: Math.random() },\r\n { x: Math.random(), y: Math.random() },\r\n ]\r\n } );\r\n}\r\n\r\nfunction sortObjectProperties( objKey, val ) {\r\n\tvar normalized, keys, i, len;\r\n\tif ( !Array.isArray( val ) \u0026\u0026 Object( val ) === val ) {\r\n\t\tnormalized = {};\r\n\t\tkeys = Object.keys( val ).sort();\r\n\t\ti = 0;\r\n\t\tlen = keys.length;\r\n\t\tfor ( ; i \u003C len; i \u002B= 1 ) {\r\n\t\t\tnormalized[keys[i]] = val[keys[i]];\r\n\t\t}\r\n\t\treturn normalized;\r\n\t} else {\r\n\t\treturn val;\r\n\t}\r\n}\r\n\r\nfunction recursiveSortedSignature( o ) {\r\n const keys = Object.keys( o ).sort();\r\n let sig = \u0027\u0027;\r\n for ( let k of keys ) {\r\n let v = o[k];\r\n if ( Object( v ) === v ) {\r\n v = recursiveSortedSignature( v );\r\n }\r\n sig \u002B= \u0060(${k}:${v})\u0060;\r\n }\r\n return sig;\r\n}\r\n\r\nfunction customSignature( o ) {\r\n const { position: { x, y }, width, height, points } = o;\r\n let pts = \u0027\u0027;\r\n for ( let point of points ) {\r\n pts \u002B= \u0060(${point.x}x${point.y})\u0060;\r\n }\r\n return \u0060@(${x},${y})#(${width},${height})*${pts}\u0060;\r\n}\r\n","TestCases":[{"Name":"JSON.stringify","Code":"for ( let shape of shapes ) {\r\n JSON.stringify( val, sortObjectProperties );\r\n}","IsDeferred":false},{"Name":"Generic signature builder","Code":"for ( let shape of shapes ) {\r\n recursiveSortedSignature( shape );\r\n}","IsDeferred":false},{"Name":"Custom signature builder","Code":"for ( let shape of shapes ) {\r\n customSignature( shape );\r\n}","IsDeferred":false}]}