{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/11425","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/11425/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/11425/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/11425/events","html_url":"https://github.com/JuliaLang/julia/issues/11425","id":80102944,"number":11425,"title":"2x performance regression when comparing types","user":{"login":"dhoegh","id":7973946,"avatar_url":"https://avatars.githubusercontent.com/u/7973946?v=3","gravatar_id":"","url":"https://api.github.com/users/dhoegh","html_url":"https://github.com/dhoegh","followers_url":"https://api.github.com/users/dhoegh/followers","following_url":"https://api.github.com/users/dhoegh/following{/other_user}","gists_url":"https://api.github.com/users/dhoegh/gists{/gist_id}","starred_url":"https://api.github.com/users/dhoegh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhoegh/subscriptions","organizations_url":"https://api.github.com/users/dhoegh/orgs","repos_url":"https://api.github.com/users/dhoegh/repos","events_url":"https://api.github.com/users/dhoegh/events{/privacy}","received_events_url":"https://api.github.com/users/dhoegh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/performance","name":"performance","color":"d7e102"},{"url":"https://api.github.com/repos/JuliaLang/julia/labels/regression","name":"regression","color":"ff2510"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-05-24T09:04:48Z","updated_at":"2015-05-25T21:57:16Z","closed_at":null,"body":"Between 8fc5b4e and 195bd01 a 2x performance regression happened on this test case:\r\n```\r\nfunction test_regression(n,T)\r\n    for i = 1:n\r\n        T != Vector{UInt16}\r\n    end\r\nend\r\n@time test_regression(10000000, Array{Float64,1})\r\n```\r\nOutput from 195bd01:\r\n```\r\njulia> @time test_regression(10000000, Array{Float64,1})\r\nelapsed time: 0.591076726 seconds (80 bytes allocated)\r\n```\r\nOutput from  8fc5b4e:\r\n```\r\njulia> @time test_regresion(10000000, Array{Float64,1})\r\nelapsed time: 0.281341196 seconds (160 bytes allocated)\r\n```\r\nThe test case are a reduction from this bench test: https://gist.github.com/ScottPJones/f3fb082ac30d337d91bc, discussed in #11004 and https://groups.google.com/forum/m/?fromgroups#!topic/julia-dev/eI3x5Een1uI.\r\n\r\nI think this is the single reason for the regression observed by @ScottPJones."},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/105324608","html_url":"https://github.com/JuliaLang/julia/issues/11425#issuecomment-105324608","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/11425","id":105324608,"user":{"login":"JeffBezanson","id":744556,"avatar_url":"https://avatars.githubusercontent.com/u/744556?v=3","gravatar_id":"","url":"https://api.github.com/users/JeffBezanson","html_url":"https://github.com/JeffBezanson","followers_url":"https://api.github.com/users/JeffBezanson/followers","following_url":"https://api.github.com/users/JeffBezanson/following{/other_user}","gists_url":"https://api.github.com/users/JeffBezanson/gists{/gist_id}","starred_url":"https://api.github.com/users/JeffBezanson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeffBezanson/subscriptions","organizations_url":"https://api.github.com/users/JeffBezanson/orgs","repos_url":"https://api.github.com/users/JeffBezanson/repos","events_url":"https://api.github.com/users/JeffBezanson/events{/privacy}","received_events_url":"https://api.github.com/users/JeffBezanson/received_events","type":"User","site_admin":false},"created_at":"2015-05-25T21:57:16Z","updated_at":"2015-05-25T21:57:16Z","body":"Fixed pretty handily by the following stylish patch:\r\n\r\n```diff\r\ndiff --git a/base/operators.jl b/base/operators.jl\r\nindex fc3e8ef..edb218f 100644\r\n--- a/base/operators.jl\r\n+++ b/base/operators.jl\r\n@@ -19,7 +19,8 @@ isless(x::FloatingPoint, y::FloatingPoint) = (!isnan(x) & isna\r\n isless(x::Real,          y::FloatingPoint) = (!isnan(x) & isnan(y)) | (signbit(\r\n isless(x::FloatingPoint, y::Real         ) = (!isnan(x) & isnan(y)) | (signbit(\r\n \r\n-==(T::Type, S::Type) = typeseq(T, S)\r\n+=={T}(::Type{T}, ::Type{T}) = true\r\n+==(T::Type, S::Type)        = false\r\n \r\n```\r\n"}}