{"ScriptPreparationCode":null,"TestCases":[{"Name":"No memo - few strings","Code":"const memoizationTwoArgs = (\r\n func\r\n) =\u003E {\r\n const cache = {};\r\n function memoFunc(a, b) {\r\n if (!cache.hasOwnProperty(a)) {\r\n cache[a] = {};\r\n }\r\n if (!cache[a].hasOwnProperty(b)) {\r\n cache[a][b] = func(a, b);\r\n }\r\n return cache[a][b];\r\n }\r\n return memoFunc;\r\n};\r\n\r\nconst randStringGen = (len) =\u003E Math.random().toString(16).substr(2, 2\u002Blen);\r\nconst randIntGen = (min, max) =\u003E parseInt((Math.random() * (max - min \u002B 1)), 10) \u002B min;\r\nconst partIds = [];\r\nfor (let i=0;i\u003C5;i\u002B\u002B) {\r\n partIds.push(randStringGen(20));\r\n}\r\nconst meetingIds = [];\r\nfor (let i=0;i\u003C2;i\u002B\u002B) {\r\n meetingIds.push(randStringGen(20));\r\n}\r\nconst func = (a,b) =\u003E \u0060${a}/${b}\u0060;\r\n\r\nfor (let i=0;i\u003C1000;i\u002B\u002B) {\r\n \tconst a = partIds[randIntGen(0, partIds.length-1)];\r\n \tconst b = meetingIds[randIntGen(0, meetingIds.length-1)];\r\n\tconsole.log(func(a,b));\r\n}","IsDeferred":false},{"Name":"Memo - few strings","Code":"const memoizationTwoArgs = (\r\n func\r\n) =\u003E {\r\n const cache = {};\r\n function memoFunc(a, b) {\r\n if (!cache.hasOwnProperty(b)) {\r\n cache[b] = {};\r\n }\r\n if (!cache[b].hasOwnProperty(a)) {\r\n cache[b][a] = func(a, b);\r\n }\r\n return cache[b][a];\r\n }\r\n return memoFunc;\r\n};\r\n\r\nconst randStringGen = (len) =\u003E Math.random().toString(16).substr(2, 2\u002Blen);\r\nconst randIntGen = (min, max) =\u003E parseInt((Math.random() * (max - min \u002B 1)), 10) \u002B min;\r\nconst partIds = [];\r\nfor (let i=0;i\u003C5;i\u002B\u002B) {\r\n partIds.push(randStringGen(20));\r\n}\r\nconst meetingIds = [];\r\nfor (let i=0;i\u003C2;i\u002B\u002B) {\r\n meetingIds.push(randStringGen(20));\r\n}\r\nconst memoFunc = memoizationTwoArgs((a,b) =\u003E \u0060${a}/${b}\u0060);\r\n\r\nfor (let i=0;i\u003C1000;i\u002B\u002B) {\r\n \tconst a = partIds[randIntGen(0, partIds.length-1)];\r\n \tconst b = meetingIds[randIntGen(0, meetingIds.length-1)];\r\n\tconsole.log(memoFunc(a,b));\r\n}","IsDeferred":false},{"Name":"no memo - many strings","Code":"const memoizationTwoArgs = (\r\n func\r\n) =\u003E {\r\n const cache = {};\r\n function memoFunc(a, b) {\r\n if (!cache.hasOwnProperty(a)) {\r\n cache[a] = {};\r\n }\r\n if (!cache[a].hasOwnProperty(b)) {\r\n cache[a][b] = func(a, b);\r\n }\r\n return cache[a][b];\r\n }\r\n return memoFunc;\r\n};\r\n\r\nconst randStringGen = (len) =\u003E Math.random().toString(16).substr(2, 2\u002Blen);\r\nconst randIntGen = (min, max) =\u003E parseInt((Math.random() * (max - min \u002B 1)), 10) \u002B min;\r\nconst partIds = [];\r\nfor (let i=0;i\u003C100;i\u002B\u002B) {\r\n partIds.push(randStringGen(20));\r\n}\r\nconst meetingIds = [];\r\nfor (let i=0;i\u003C2;i\u002B\u002B) {\r\n meetingIds.push(randStringGen(20));\r\n}\r\nconst func = (a,b) =\u003E \u0060${a}/${b}\u0060;\r\n\r\nfor (let i=0;i\u003C1000;i\u002B\u002B) {\r\n \tconst a = partIds[randIntGen(0, partIds.length-1)];\r\n \tconst b = meetingIds[randIntGen(0, meetingIds.length-1)];\r\n\tconsole.log(func(a,b));\r\n}","IsDeferred":false},{"Name":"memo - many strings","Code":"const memoizationTwoArgs = (\r\n func\r\n) =\u003E {\r\n const cache = {};\r\n function memoFunc(a, b) {\r\n if (!cache.hasOwnProperty(b)) {\r\n cache[b] = {};\r\n }\r\n if (!cache[b].hasOwnProperty(a)) {\r\n cache[b][a] = func(a, b);\r\n }\r\n return cache[b][a];\r\n }\r\n return memoFunc;\r\n};\r\n\r\n\r\nconst randStringGen = (len) =\u003E Math.random().toString(16).substr(2, 2\u002Blen);\r\nconst randIntGen = (min, max) =\u003E parseInt((Math.random() * (max - min \u002B 1)), 10) \u002B min;\r\nconst partIds = [];\r\nfor (let i=0;i\u003C100;i\u002B\u002B) {\r\n partIds.push(randStringGen(20));\r\n}\r\nconst meetingIds = [];\r\nfor (let i=0;i\u003C2;i\u002B\u002B) {\r\n meetingIds.push(randStringGen(20));\r\n}\r\nconst memoFunc = memoizationTwoArgs((a,b) =\u003E \u0060${a}/${b}\u0060);\r\n\r\nfor (let i=0;i\u003C1000;i\u002B\u002B) {\r\n \tconst a = partIds[randIntGen(0, partIds.length-1)];\r\n \tconst b = meetingIds[randIntGen(0, meetingIds.length-1)];\r\n\tconsole.log(memoFunc(a,b));\r\n}","IsDeferred":false},{"Name":"no memo - big strings","Code":"const memoizationTwoArgs = (\r\n func\r\n) =\u003E {\r\n const cache = {};\r\n function memoFunc(a, b) {\r\n if (!cache.hasOwnProperty(a)) {\r\n cache[a] = {};\r\n }\r\n if (!cache[a].hasOwnProperty(b)) {\r\n cache[a][b] = func(a, b);\r\n }\r\n return cache[a][b];\r\n }\r\n return memoFunc;\r\n};\r\n\r\nconst randStringGen = (len) =\u003E Math.random().toString(16).substr(2, 2\u002Blen);\r\nconst randIntGen = (min, max) =\u003E parseInt((Math.random() * (max - min \u002B 1)), 10) \u002B min;\r\nconst partIds = [];\r\nfor (let i=0;i\u003C5;i\u002B\u002B) {\r\n partIds.push(randStringGen(100));\r\n}\r\nconst meetingIds = [];\r\nfor (let i=0;i\u003C2;i\u002B\u002B) {\r\n meetingIds.push(randStringGen(100));\r\n}\r\nconst func = (a,b) =\u003E \u0060${a}/${b}\u0060;\r\n\r\nfor (let i=0;i\u003C1000;i\u002B\u002B) {\r\n \tconst a = partIds[randIntGen(0, partIds.length-1)];\r\n \tconst b = meetingIds[randIntGen(0, meetingIds.length-1)];\r\n\tconsole.log(func(a,b));\r\n}","IsDeferred":false},{"Name":"memo - big strings","Code":"const memoizationTwoArgs = (\r\n func\r\n) =\u003E {\r\n const cache = {};\r\n function memoFunc(a, b) {\r\n if (!cache.hasOwnProperty(b)) {\r\n cache[b] = {};\r\n }\r\n if (!cache[b].hasOwnProperty(a)) {\r\n cache[b][a] = func(a, b);\r\n }\r\n return cache[b][a];\r\n }\r\n return memoFunc;\r\n};\r\n\r\nconst randStringGen = (len) =\u003E Math.random().toString(16).substr(2, 2\u002Blen);\r\nconst randIntGen = (min, max) =\u003E parseInt((Math.random() * (max - min \u002B 1)), 10) \u002B min;\r\nconst partIds = [];\r\nfor (let i=0;i\u003C5;i\u002B\u002B) {\r\n partIds.push(randStringGen(100));\r\n}\r\nconst meetingIds = [];\r\nfor (let i=0;i\u003C2;i\u002B\u002B) {\r\n meetingIds.push(randStringGen(100));\r\n}\r\nconst memoFunc = memoizationTwoArgs((a,b) =\u003E \u0060${a}/${b}\u0060);\r\n\r\nfor (let i=0;i\u003C1000;i\u002B\u002B) {\r\n \tconst a = partIds[randIntGen(0, partIds.length-1)];\r\n \tconst b = meetingIds[randIntGen(0, meetingIds.length-1)];\r\n\tconsole.log(memoFunc(a,b));\r\n}","IsDeferred":false}]}