Giter Site home page Giter Site logo

step() slowness about itertools HOT 6 CLOSED

rust-itertools avatar rust-itertools commented on August 29, 2024
step() slowness

from itertools.

Comments (6)

bluss avatar bluss commented on August 29, 2024

It's not really surprising, .step() is written for general iterators and uses .fuse() among other things (whose performance impediment is well known).

from itertools.

palacaze avatar palacaze commented on August 29, 2024

Thanks for the explanation. I see now that step_by() is only implemented for ranges.
Should the performance implications be mentioned in the documentation, as a few iterators, such as interleave(), make use of Fuse internally?

from itertools.

bluss avatar bluss commented on August 29, 2024

It's not just fuse, it's a lot of stuff that needs to be covered. Every adaptor could have its own performance story explained.

Step could possibly be improved with specialization (also fuse-related specialization).

from itertools.

bluss avatar bluss commented on August 29, 2024

One prerequisite for making the best step iterator for slices (like Stride/StrideMut) is to have arith_offset as a stable function. Then specialization to let us do interesting specializations in itertools itself.

from itertools.

bluss avatar bluss commented on August 29, 2024

std has Iterator::step_by now. We can deprecate step() when it's stable.

from itertools.

bluss avatar bluss commented on August 29, 2024

Step has been deprecated in itertools 0.8

from itertools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.