{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/10907","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/10907/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/10907/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/10907/events","html_url":"https://github.com/JuliaLang/julia/issues/10907","id":69563227,"number":10907,"title":"Indeterministic unique(a) results and possible efficiency improvement","user":{"login":"jhlq","id":6324698,"avatar_url":"https://avatars.githubusercontent.com/u/6324698?v=3","gravatar_id":"","url":"https://api.github.com/users/jhlq","html_url":"https://github.com/jhlq","followers_url":"https://api.github.com/users/jhlq/followers","following_url":"https://api.github.com/users/jhlq/following{/other_user}","gists_url":"https://api.github.com/users/jhlq/gists{/gist_id}","starred_url":"https://api.github.com/users/jhlq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhlq/subscriptions","organizations_url":"https://api.github.com/users/jhlq/orgs","repos_url":"https://api.github.com/users/jhlq/repos","events_url":"https://api.github.com/users/jhlq/events{/privacy}","received_events_url":"https://api.github.com/users/jhlq/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-20T11:11:43Z","updated_at":"2015-04-20T15:44:04Z","closed_at":null,"body":"Was at first surprised that unique doesn't filter custom types even if they evaluate to equal by == but the helpdoc does say they should be equivalent and \\equiv evaluates to ``` is ```, however have noticed several times on both 0.3 and 0.4 that functions filling up an array with objects created through permutations and then ``` return unique(result) ``` will produce an array of variable length from a deterministic algorithm. The most recent encounter was with ``` findpows ``` ([in this commit](https://github.com/jhlq/Equations.jl/commit/9c030fc76f41c295a40541c190bf60fc266ef51f)) before unique was replaced with uniquefilter. Have not had the handpower to unwrap a case into a neat isolated example and would not have opened this if not for the following unearthed feature of ``` uniquefilter{T}(a::Array{T})=pushallunique!(T[],a) ```:\r\n\r\n```\r\njulia> r=rand(Int,1000000)%3;\r\n\r\njulia> @time for i in 1:1000;unique(r);end\r\nelapsed time: 23.492532326 seconds (560000 bytes allocated)\r\n\r\njulia> @time for i in 1:1000;Equations.uniquefilter(r);end\r\nelapsed time: 11.805153784 seconds (160000 bytes allocated)\r\n```"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/94488504","html_url":"https://github.com/JuliaLang/julia/issues/10907#issuecomment-94488504","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/10907","id":94488504,"user":{"login":"jhlq","id":6324698,"avatar_url":"https://avatars.githubusercontent.com/u/6324698?v=3","gravatar_id":"","url":"https://api.github.com/users/jhlq","html_url":"https://github.com/jhlq","followers_url":"https://api.github.com/users/jhlq/followers","following_url":"https://api.github.com/users/jhlq/following{/other_user}","gists_url":"https://api.github.com/users/jhlq/gists{/gist_id}","starred_url":"https://api.github.com/users/jhlq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhlq/subscriptions","organizations_url":"https://api.github.com/users/jhlq/orgs","repos_url":"https://api.github.com/users/jhlq/repos","events_url":"https://api.github.com/users/jhlq/events{/privacy}","received_events_url":"https://api.github.com/users/jhlq/received_events","type":"User","site_admin":false},"created_at":"2015-04-20T15:44:04Z","updated_at":"2015-04-20T15:44:04Z","body":"Yeah previously there has been a lot of duplicates due to using permutations to match everything, have implemented expression sorting now so the location of numbers symbols and components are known which will make it possible to phase out permutations.\r\n\r\nWill make a branch with immutables and see how that works out."}}