-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Old interface for searchsorted* are not type stable anymore #18369
Comments
Oh and I mean deprecating this right now for v0.5 final unless you wish to do (b) or (c) sometime in the future (and I can't see that (c) is feasible, but I may be wrong). |
This looks like the same issue as #8991. Has something changed here? |
This can probably be fixed by allowing |
The |
Yeah, this is on my todo list if someone else doesn't get to it first. |
Oh, sorry, I didn't see that one (it's sometimes hard when there are 1610 open issues).
With the latter part in mind, what is the plan, @StefanKarpinski? Get rid of |
I added the definition Line 194 in 2ab4a0d
|
OK I think so but I had to use the Is it possible to cover all the signatures that don't have Also, should we document this stuff (#18370) or is this all changing? It seems to have existed a while without documentation. |
We should at least document how it currently works for the sake of the release where it isn't going to change API. That added method also overwrites the default no-keyword method causing some annoying warnings during system image compilation, if any package were to try and do the same thing I don't think users would like it very much. |
With keyword arguments you are basically screwed no matter what as far as performance goes, at least until #16580. |
And the whole sorting API should change now that we have jb/functions. |
If you don't explicitly pass |
After finding unusual allocations in my code, I found some (undocumented!) changes to search using the new
Ordering
parameters. Which are really, really neat, but the backup option for the old interface at https://github.com/JuliaLang/julia/blob/master/base/sort.jl#L193 is not type stable:The problem is the type returned by
ord
depends on the value of the booleanrev
at https://github.com/JuliaLang/julia/blob/master/base/ordering.jl#L72. Using the new interface for this one method made my overall algorithm (spatial querying in 3D) twice as fast and allocate significantly less memory, so I think this is important.I think we need to either (a) insert a deprecation warning so people know to switch their code, or (b) include the old methods, or (c) think of an alternative, type-stable workaround.
The text was updated successfully, but these errors were encountered: