Performance of any

  • memeplex

    memeplex - 2007-06-02


    current any() implementation has very bad performance in the general case because it first converts the original collection into a boolean collection, so it has to go through the entire collections no matter whether the first value happens to be true. I think it must shortcut evaluation as soon as a true value is found, and do nothing more than this. Implementation on top of or/and could be very elegant, but also really expensive regarding time/memory costs. The same for all().

    Thank you for your work.

    • Fred Daoud

      Fred Daoud - 2007-06-10

      Hi Carlos,
      Agreed. I'll make note to fix this for the next release.
      Thank you,


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks