The performance of findfirst(A, value) has significantly been affected in 0.7. It’s understandable that the method is deprecated. But changing the functionality in a manner that performance is substantially affected can be a significant issue for applications where it has been used. Here are some numbers from 0.6 and 0.7 for comparison.
julia> a = fill(1, 2048); @time findfirst(a, 4)
┌ Warning: `findfirst(A, v)` is deprecated, use `coalesce(findfirst(isequal(v), A), 0)` instead.
│ caller = top-level scope at util.jl:156
└ @ Core util.jl:156
0.002726 seconds (372 allocations: 23.250 KiB)
0
The sheer number of allocations are good enough indication that there is lots more happening within the method now in 0.7. Because of this some code is almost crawling in their 0.7 implementation which were fairly fast in 0.6.
Please note that the measurements are after several runs so initial start up overheads have been eliminated already.
@kristoffer.carlsson Your suggested code cannot be run with 0.6 as Fix2 was not defined in 0.6. Deprecation should mean the functionality will be removed not something that was working will not perform. Otherwise one has to keep on implementing 2 versions in the code till 0.7 is released.
By the way, when did we get currying? I didn’t think any of this was going to happen until after 1.0? (When I thought we would get general currying with _.) It looks like there are some functions in Base that just have explicit currying methods, but I can’t see which. Is there a link to the issue?
Not sure. One has to think the ‘to’ part - the function is called ‘isequal’ and not ‘isequalto’ - but then yes, it reads pretty cleanly. If one just enters isequal(4) into the console to find out what this could mean, it won’t work. - Will try to read it as a sentence, this is a good hint.