Code Monkey home page Code Monkey logo

pipeliner's Introduction

Pipeliner

Pipeliner is a Rust library to help you create multithreaded work pipelines. You can choose how many threads each step of the pipeline uses to tune performance for I/O- or CPU-bound workloads.

The API docs contain code examples.

Links

Comparison with Rayon

Rayon is another Rust library for parallel computation. If you're doing purely CPU-bound work, you may want to try that out to see if it offers better performance.

Pipeliner, IMHO, offers a simpler interface. That simpler interface makes it easier to combine parts of a data pipeline that may be I/O-bound and CPU-bound. Usually in those cases, your bottleneck is I/O, not the speed of your parallel execution library, so having a nice API may be preferable.

pipeliner's People

Contributors

centril avatar nfnitloop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pipeliner's Issues

Allow Scaling with_threads() w/ # CPUs

Could with_threads(0) mean number of CPUs in the system? That's actually most typical usage.

Any chance of getting ordered output? Only then it's a plug-and-play solution for everyone.

Add support for async pipelines

Pipeliner was created before Rust's async/.await functionality became available in stable. It uses OS threads for both CPU-bound and I/O-bound computation. But async code is much more efficient for I/O-bound work, since you can efficiently wait for I/O without needing a whole thread.

I'd like to update Pipeliner to support async I/O. Some thoughts:

  • allow mixing async/sync code. This would work well for putting I/O-bound code in async executors, and CPU-bound code on threads.
  • Is there a way to make it pluggable so it works for tokio and async-std, or do I need to do that manually w/ feature flags?

If you'd like this feature, please leave a comment orπŸ‘.

Lifetime flexibility

Why does PipelineBuilder::map require a callable that has a lifetime of static? Is there a problem with passing through the lifetime of whatever callable is provided? (i.e. the callable has to live at least as long as the iterator does so that there's no attempt to call a deallocated object) I ask because I was attempting to use this in a context where the callable was a closure, which I believe is sound because I reduce the iterator before the caller to map exits, so there is no possibility of calling a deallocated function.

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.