Fix performance regression of some find() methods #25489
Labels
performance
Must go faster
regression
Regression in behavior compared to a previous version
search & find
The find* family of functions
Changes to
find
made by #24774 introduced some performance regressions (see #24774 (comment)). Unlesspush!
can be made efficient enough (#24909), we should probably introduce a specialized method forAbstractArray{Bool}
which would compute the number of true entries, allocate a vector of the required size and fill it, as was done before. This is not possible for general iterables since it is not guaranteed that they can be accessed several times, but it should be possible to also apply this strategy to generators, when the backing iterator is an array.find
also appears to have slightly regressed on generators, but it's not clear whether this regression is real nor why it happens. If new Nanosoldier runs confirm it, it should be investigated.The text was updated successfully, but these errors were encountered: