{"ScriptPreparationCode":"var objectString = {\r\n \u0022reportActions_1234\u0022: {\r\n action: \u0022view\u0022,\r\n timestamp: \u00222024-07-17T10:15:30Z\u0022,\r\n user: \u0022JohnDoe\u0022\r\n },\r\n \u0022reportActions_5678\u0022: {\r\n action: \u0022edit\u0022,\r\n timestamp: \u00222024-07-17T11:20:45Z\u0022,\r\n user: \u0022JaneSmith\u0022\r\n },\r\n \u0022reportActions_91011\u0022: {\r\n action: \u0022delete\u0022,\r\n timestamp: \u00222024-07-17T12:25:50Z\u0022,\r\n user: \u0022AlexJohnson\u0022\r\n },\r\n \u0022reportActions_1213\u0022: {\r\n action: \u0022create\u0022,\r\n timestamp: \u00222024-07-17T13:30:55Z\u0022,\r\n user: \u0022EmilyBrown\u0022\r\n },\r\n \u0022reportActions_1415\u0022: {\r\n action: \u0022share\u0022,\r\n timestamp: \u00222024-07-17T14:35:00Z\u0022,\r\n user: \u0022ChrisDavis\u0022\r\n },\r\n \u0022reportActions_1235\u0022: {\r\n action: \u0022view\u0022,\r\n timestamp: \u00222024-07-17T10:15:30Z\u0022,\r\n user: \u0022JohnDoe\u0022\r\n },\r\n \u0022reportActions_5679\u0022: {\r\n action: \u0022edit\u0022,\r\n timestamp: \u00222024-07-17T11:20:45Z\u0022,\r\n user: \u0022JaneSmith\u0022\r\n },\r\n \u0022reportActions_91021\u0022: {\r\n action: \u0022delete\u0022,\r\n timestamp: \u00222024-07-17T12:25:50Z\u0022,\r\n user: \u0022AlexJohnson\u0022\r\n },\r\n \u0022reportActions_1214\u0022: {\r\n action: \u0022create\u0022,\r\n timestamp: \u00222024-07-17T13:30:55Z\u0022,\r\n user: \u0022EmilyBrown\u0022\r\n },\r\n \u0022reportActions_1416\u0022: {\r\n action: \u0022share\u0022,\r\n timestamp: \u00222024-07-17T14:35:00Z\u0022,\r\n user: \u0022ChrisDavis\u0022\r\n },\r\n \u0022report_1234\u0022: {\r\n action: \u0022view\u0022,\r\n timestamp: \u00222024-07-17T10:15:30Z\u0022,\r\n user: \u0022JohnDoe\u0022\r\n },\r\n \u0022report_5678\u0022: {\r\n action: \u0022edit\u0022,\r\n timestamp: \u00222024-07-17T11:20:45Z\u0022,\r\n user: \u0022JaneSmith\u0022\r\n },\r\n \u0022report_91011\u0022: {\r\n action: \u0022delete\u0022,\r\n timestamp: \u00222024-07-17T12:25:50Z\u0022,\r\n user: \u0022AlexJohnson\u0022\r\n },\r\n \u0022report_1213\u0022: {\r\n action: \u0022create\u0022,\r\n timestamp: \u00222024-07-17T13:30:55Z\u0022,\r\n user: \u0022EmilyBrown\u0022\r\n },\r\n \u0022report_1415\u0022: {\r\n action: \u0022share\u0022,\r\n timestamp: \u00222024-07-17T14:35:00Z\u0022,\r\n user: \u0022ChrisDavis\u0022\r\n },\r\n \u0022report_1235\u0022: {\r\n action: \u0022view\u0022,\r\n timestamp: \u00222024-07-17T10:15:30Z\u0022,\r\n user: \u0022JohnDoe\u0022\r\n },\r\n \u0022report_5679\u0022: {\r\n action: \u0022edit\u0022,\r\n timestamp: \u00222024-07-17T11:20:45Z\u0022,\r\n user: \u0022JaneSmith\u0022\r\n },\r\n \u0022report_91021\u0022: {\r\n action: \u0022delete\u0022,\r\n timestamp: \u00222024-07-17T12:25:50Z\u0022,\r\n user: \u0022AlexJohnson\u0022\r\n },\r\n \u0022report_1214\u0022: {\r\n action: \u0022create\u0022,\r\n timestamp: \u00222024-07-17T13:30:55Z\u0022,\r\n user: \u0022EmilyBrown\u0022\r\n },\r\n \u0022report_1416\u0022: {\r\n action: \u0022share\u0022,\r\n timestamp: \u00222024-07-17T14:35:00Z\u0022,\r\n user: \u0022ChrisDavis\u0022\r\n }\r\n};\r\n\r\nvar reportActionIds = [\r\n \u00221234\u0022, \u00225678\u0022, \u002291011\u0022, \u00221213\u0022, \u00221415\u0022, \r\n \u00221235\u0022, \u00225679\u0022, \u002291021\u0022, \u00221214\u0022, \u00221416\u0022\r\n];\r\nvar reportIds = [\r\n \u00221234\u0022, \u00225678\u0022, \u002291011\u0022, \u00221213\u0022, \u00221415\u0022, \r\n \u00221235\u0022, \u00225679\u0022, \u002291021\u0022, \u00221214\u0022, \u00221416\u0022\r\n];","TestCases":[{"Name":"no caching","Code":"function getString(collection, id) {\r\n\treturn \u0060${collection}${id}\u0060;\r\n}\r\n\r\nfor (let i of reportActionIds) {\r\n objectString[getString(\u0022reportActions_\u0022, i)];\r\n}\r\n\r\nfor (let i of reportIds) {\r\n objectString[getString(\u0022report_\u0022, i)];\r\n}\r\n\r\nfor (let i of reportActionIds) {\r\n objectString[getString(\u0022reportActions_\u0022, i)];\r\n}\r\n\r\nfor (let i of reportIds) {\r\n objectString[getString(\u0022report_\u0022, i)];\r\n}","IsDeferred":false},{"Name":"caching","Code":"const cache = {};\r\n\r\nfunction getString(collection, id) {\r\n \tif (!cache[collection]) {\r\n cache[collection] = {};\r\n }\r\n\r\n if (cache[collection][id]) {\r\n return cache[collection][id];\r\n }\r\n \tcache[collection][id] = \u0060${collection}${id}\u0060;\r\n\treturn cache[collection][id];\r\n}\r\n\r\nfor (let i of reportActionIds) {\r\n objectString[getString(\u0022reportActions_\u0022, i)];\r\n}\r\n\r\nfor (let i of reportIds) {\r\n objectString[getString(\u0022report_\u0022, i)];\r\n}\r\n\r\nfor (let i of reportActionIds) {\r\n objectString[getString(\u0022reportActions_\u0022, i)];\r\n}\r\n\r\nfor (let i of reportIds) {\r\n objectString[getString(\u0022report_\u0022, i)];\r\n}\r\nconsole.log(cache);","IsDeferred":false}]}