{"action":"created","issue":{"url":"https://api.github.com/repos/ramda/ramda/issues/1376","labels_url":"https://api.github.com/repos/ramda/ramda/issues/1376/labels{/name}","comments_url":"https://api.github.com/repos/ramda/ramda/issues/1376/comments","events_url":"https://api.github.com/repos/ramda/ramda/issues/1376/events","html_url":"https://github.com/ramda/ramda/issues/1376","id":105484303,"number":1376,"title":"R.indexOf is quite slow","user":{"login":"jseppi","id":697848,"avatar_url":"https://avatars.githubusercontent.com/u/697848?v=3","gravatar_id":"","url":"https://api.github.com/users/jseppi","html_url":"https://github.com/jseppi","followers_url":"https://api.github.com/users/jseppi/followers","following_url":"https://api.github.com/users/jseppi/following{/other_user}","gists_url":"https://api.github.com/users/jseppi/gists{/gist_id}","starred_url":"https://api.github.com/users/jseppi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jseppi/subscriptions","organizations_url":"https://api.github.com/users/jseppi/orgs","repos_url":"https://api.github.com/users/jseppi/repos","events_url":"https://api.github.com/users/jseppi/events{/privacy}","received_events_url":"https://api.github.com/users/jseppi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-08T22:48:44Z","updated_at":"2015-09-09T15:22:16Z","closed_at":null,"body":"I was writing some code that made considerable use of `R.contains` and noticed that the performance was pretty poor so I dug a little into the underlying code. It appears the performance issue is `R.indexOf`, which is considerably slower (orders of magnitude) than browser-native `indexOf`. Here is a jsPerf test illustrating the difference: http://jsperf.com/ramda-indexof/2\r\n\r\nFor the code I was writing, I was calling `R.contains` about 400 times successively, and that section of code was taking over 3 seconds. Using browser-native `indexOf` has reduced the time to about 16 milliseconds."},"comment":{"url":"https://api.github.com/repos/ramda/ramda/issues/comments/138945064","html_url":"https://github.com/ramda/ramda/issues/1376#issuecomment-138945064","issue_url":"https://api.github.com/repos/ramda/ramda/issues/1376","id":138945064,"user":{"login":"jseppi","id":697848,"avatar_url":"https://avatars.githubusercontent.com/u/697848?v=3","gravatar_id":"","url":"https://api.github.com/users/jseppi","html_url":"https://github.com/jseppi","followers_url":"https://api.github.com/users/jseppi/followers","following_url":"https://api.github.com/users/jseppi/following{/other_user}","gists_url":"https://api.github.com/users/jseppi/gists{/gist_id}","starred_url":"https://api.github.com/users/jseppi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jseppi/subscriptions","organizations_url":"https://api.github.com/users/jseppi/orgs","repos_url":"https://api.github.com/users/jseppi/repos","events_url":"https://api.github.com/users/jseppi/events{/privacy}","received_events_url":"https://api.github.com/users/jseppi/received_events","type":"User","site_admin":false},"created_at":"2015-09-09T15:22:16Z","updated_at":"2015-09-09T15:22:16Z","body":":+1: Thanks for taking the time to think through this issue. I appreciate all the devs' hard work on Ramda!"}}