{"action":"created","issue":{"url":"https://api.github.com/repos/ramda/ramda/issues/2476","repository_url":"https://api.github.com/repos/ramda/ramda","labels_url":"https://api.github.com/repos/ramda/ramda/issues/2476/labels{/name}","comments_url":"https://api.github.com/repos/ramda/ramda/issues/2476/comments","events_url":"https://api.github.com/repos/ramda/ramda/issues/2476/events","html_url":"https://github.com/ramda/ramda/issues/2476","id":298865939,"number":2476,"title":"R.equals takes a long time for same objects","user":{"login":"Masoud-MSK","id":11862153,"avatar_url":"https://avatars3.githubusercontent.com/u/11862153?v=4","gravatar_id":"","url":"https://api.github.com/users/Masoud-MSK","html_url":"https://github.com/Masoud-MSK","followers_url":"https://api.github.com/users/Masoud-MSK/followers","following_url":"https://api.github.com/users/Masoud-MSK/following{/other_user}","gists_url":"https://api.github.com/users/Masoud-MSK/gists{/gist_id}","starred_url":"https://api.github.com/users/Masoud-MSK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Masoud-MSK/subscriptions","organizations_url":"https://api.github.com/users/Masoud-MSK/orgs","repos_url":"https://api.github.com/users/Masoud-MSK/repos","events_url":"https://api.github.com/users/Masoud-MSK/events{/privacy}","received_events_url":"https://api.github.com/users/Masoud-MSK/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2018-02-21T07:26:32Z","updated_at":"2018-02-25T17:11:56Z","closed_at":null,"author_association":"NONE","body":"assume:\r\n```\r\nconst a = {}\r\nconst eq = (a, b) => a === b ? R.equals(a, b)\r\n```\r\nI ran `eq(a, a)` and `R.equals(a, a)` 100 million each and `eq` took about 17 ms but the latter took around 7800 ms which is 400 times slower. I wonder why?!\r\nIt's VERY important because `R.equals` is used in some other functions such as `uniq` which is in the order of n^2."},"comment":{"url":"https://api.github.com/repos/ramda/ramda/issues/comments/368326127","html_url":"https://github.com/ramda/ramda/issues/2476#issuecomment-368326127","issue_url":"https://api.github.com/repos/ramda/ramda/issues/2476","id":368326127,"user":{"login":"CrossEye","id":151263,"avatar_url":"https://avatars0.githubusercontent.com/u/151263?v=4","gravatar_id":"","url":"https://api.github.com/users/CrossEye","html_url":"https://github.com/CrossEye","followers_url":"https://api.github.com/users/CrossEye/followers","following_url":"https://api.github.com/users/CrossEye/following{/other_user}","gists_url":"https://api.github.com/users/CrossEye/gists{/gist_id}","starred_url":"https://api.github.com/users/CrossEye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CrossEye/subscriptions","organizations_url":"https://api.github.com/users/CrossEye/orgs","repos_url":"https://api.github.com/users/CrossEye/repos","events_url":"https://api.github.com/users/CrossEye/events{/privacy}","received_events_url":"https://api.github.com/users/CrossEye/received_events","type":"User","site_admin":false},"created_at":"2018-02-25T17:11:56Z","updated_at":"2018-02-25T17:11:56Z","author_association":"OWNER","body":"> Did you see the example I posted above?\r\n\r\nSorry, just being dense.  I've discussed the same example before, but just wasn't thinking of it here, even though I'm the one who brought up `-0`.  D'oh!\r\n\r\n> On the other hand, the fact that `-0` is not equal to `0` seems to violate basic knowledge from math. It's really just implementation artifacts from the floating point numbers leaking out.\r\n\r\nI've always had a hard time with this.\r\n\r\nPerhaps we need a slightly more sophisticated version that checks for a `-0` before checking primitive equality.  That wouldn't be hard to write, but is somehow less convincing."}}
{"actor":{"display_login":"CrossEye"}}