{"action":"closed","issue":{"url":"https://api.github.com/repos/epoberezkin/ajv/issues/623","repository_url":"https://api.github.com/repos/epoberezkin/ajv","labels_url":"https://api.github.com/repos/epoberezkin/ajv/issues/623/labels{/name}","comments_url":"https://api.github.com/repos/epoberezkin/ajv/issues/623/comments","events_url":"https://api.github.com/repos/epoberezkin/ajv/issues/623/events","html_url":"https://github.com/epoberezkin/ajv/issues/623","id":274976085,"number":623,"title":"UniqueItems is very slow","user":{"login":"akomiagin","id":33763233,"avatar_url":"https://avatars2.githubusercontent.com/u/33763233?v=4","gravatar_id":"","url":"https://api.github.com/users/akomiagin","html_url":"https://github.com/akomiagin","followers_url":"https://api.github.com/users/akomiagin/followers","following_url":"https://api.github.com/users/akomiagin/following{/other_user}","gists_url":"https://api.github.com/users/akomiagin/gists{/gist_id}","starred_url":"https://api.github.com/users/akomiagin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akomiagin/subscriptions","organizations_url":"https://api.github.com/users/akomiagin/orgs","repos_url":"https://api.github.com/users/akomiagin/repos","events_url":"https://api.github.com/users/akomiagin/events{/privacy}","received_events_url":"https://api.github.com/users/akomiagin/received_events","type":"User","site_admin":false},"labels":[{"id":213637992,"url":"https://api.github.com/repos/epoberezkin/ajv/labels/duplicate","name":"duplicate","color":"cccccc","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-11-17T19:44:57Z","updated_at":"2017-11-17T21:17:04Z","closed_at":"2017-11-17T21:17:04Z","author_association":"NONE","body":"We need to check the array items to be unique. We have 160 000 and it takes forever to validate. The problem is that the uniqueItems algorithm is very slow as it sorts elements and uses for loop.\r\nWhy not use hash tables for that? Something like that:\r\n\r\n```\r\nfunction hasDuplicates(array) {\r\n    return (new Set(array)).size !== array.length;\r\n}\r\n```"}}
{"actor":{"display_login":"epoberezkin"}}