{"ScriptPreparationCode":"var permissionList = Array.from({\r\n length: 1000000\r\n}, (i, j) =\u003E ({\r\n app: \u0022oxygen\u0022,\r\n resource: \u0022user\u0022,\r\n action: \u0022profile\u0022,\r\n group: \u0022Group\u0022 \u002B j,\r\n isAllowed: true\r\n}));\r\n\r\nvar payload = {\r\n \u0022app\u0022: \u0022oxygen\u0022,\r\n \u0022resource\u0022: \u0022user\u0022,\r\n \u0022action\u0022: \u0022profile\u0022,\r\n \u0022groups\u0022: Array.from({\r\n length: 110000\r\n }, (i, j) =\u003E \u0022Group\u0022 \u002B j),\r\n \u0022isAllowed\u0022: false\r\n};","TestCases":[{"Name":"Set","Code":"const filter = permissionList\r\n .filter(permission =\u003E permission.action === payload.action \u0026\u0026 permission.resource === payload.resource)\r\n .map(permission =\u003E permission.group);\r\nconst groupSet = new Set(filter);\r\nconst missingGroups = payload.groups.filter(group =\u003E !groupSet.has(group));","IsDeferred":false},{"Name":"Lodash group","Code":"const filter = permissionList\r\n .filter(permission =\u003E permission.action === payload.action \u0026\u0026 permission.resource === payload.resource);\r\nconst groupSet = _.groupBy(filter, \u0027group\u0027);\r\nconst missingGroups = payload.groups.filter(group =\u003E !groupSet[group]);","IsDeferred":false},{"Name":"Map","Code":"const groupSet = {};\r\npermissionList.forEach(permission =\u003E {\r\n groupSet[permission.group] = permission.action === payload.action \u0026\u0026 permission.resource === payload.resource;\r\n});\r\nconst missingGroups = payload.groups.filter(group =\u003E !groupSet[group]);","IsDeferred":false}]}