Skip to content

Fix performance regression of some find() methods #25489

Closed
@nalimilan

Description

Changes to find made by #24774 introduced some performance regressions (see #24774 (comment)). Unless push! can be made efficient enough (#24909), we should probably introduce a specialized method for AbstractArray{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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    performanceMust go fasterregressionRegression in behavior compared to a previous versionsearch & findThe find* family of functions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions