diff --git a/base/abstractset.jl b/base/abstractset.jl index 8291adf517922..2e81f258cb737 100644 --- a/base/abstractset.jl +++ b/base/abstractset.jl @@ -215,6 +215,16 @@ false ``` """ function issubset(l, r) + + rlen = length(r) + #This threshold was empirically determined by repeatedly + #sampling using these two methods. + lenthresh = 70 + + if rlen > lenthresh && !isa(r, AbstractSet) + return issubset(l, Set(r)) + end + for elt in l if !in(elt, r) return false