All Projects → stjepangolemac → pareach

stjepangolemac / pareach

Licence: MIT license
a tiny function that "parallelizes" work in NodeJS

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to pareach

java-multithread
Códigos feitos para o curso de Multithreading com Java, no canal RinaldoDev do YouTube.
Stars: ✭ 24 (+26.32%)
Mutual labels:  parallel, concurrent
node-bogota
🚀 Run tape tests concurrently with tap-spec output
Stars: ✭ 15 (-21.05%)
Mutual labels:  parallel, concurrent
YACLib
Yet Another Concurrency Library
Stars: ✭ 193 (+915.79%)
Mutual labels:  parallel, concurrent
Cloe
Cloe programming language
Stars: ✭ 398 (+1994.74%)
Mutual labels:  parallel, concurrent
Suman
🌇 🌆 🌉 Advanced, user-friendly, language-agnostic, super-high-performance test runner. http://sumanjs.org
Stars: ✭ 57 (+200%)
Mutual labels:  parallel, concurrent
Pytest Parallel
A pytest plugin for parallel and concurrent testing
Stars: ✭ 146 (+668.42%)
Mutual labels:  parallel, concurrent
web-scraping-engine
A simple web scraping engine supporting concurrent and anonymous scraping
Stars: ✭ 27 (+42.11%)
Mutual labels:  parallel, concurrent
Ultra Runner
🏃⛰ Ultra fast monorepo script runner and build tool
Stars: ✭ 496 (+2510.53%)
Mutual labels:  parallel, concurrent
Hamsters.js
100% Vanilla Javascript Multithreading & Parallel Execution Library
Stars: ✭ 517 (+2621.05%)
Mutual labels:  parallel, concurrent
Rubico
[a]synchronous functional programming
Stars: ✭ 133 (+600%)
Mutual labels:  parallel, concurrent
Util
A collection of useful utility functions
Stars: ✭ 201 (+957.89%)
Mutual labels:  parallel, concurrent
t8code
Parallel algorithms and data structures for tree-based AMR with arbitrary element shapes.
Stars: ✭ 37 (+94.74%)
Mutual labels:  parallel
simplx
C++ development framework for building reliable cache-friendly distributed and concurrent multicore software
Stars: ✭ 61 (+221.05%)
Mutual labels:  concurrent
WAND-PIC
WAND-PIC
Stars: ✭ 20 (+5.26%)
Mutual labels:  parallel
hlswatch
keep track of hls viewer stats
Stars: ✭ 44 (+131.58%)
Mutual labels:  concurrent
Parrows
Using Arrows to model parallel processes/computations.
Stars: ✭ 18 (-5.26%)
Mutual labels:  parallel
spellbook
Functional library for Javascript
Stars: ✭ 14 (-26.32%)
Mutual labels:  parallel
await
28Kb, small memory footprint, single binary that run list of commands in parallel and waits for their termination
Stars: ✭ 73 (+284.21%)
Mutual labels:  parallel
Java-AgentSpeak
LightJason - AgentSpeak(L++) for Java
Stars: ✭ 21 (+10.53%)
Mutual labels:  parallel
parallel-event-emitter
Parallel event emitter built on futures-rs
Stars: ✭ 29 (+52.63%)
Mutual labels:  parallel

parEach - a tiny function that "parallelizes" work for NodeJS

How to install:

npm install pareach

How to use:

const parEach = require('pareach');

await parEach(work, args[, options]);
  • work - an async function that accepts the args provided
  • args - an array of arguments to call the work function (if you pass more than one then use a nested array [['foo', 'bar'], ...])
  • options - a configuration object
    • concurrencyLimit - which is 5 by default, controls concurrency per thread
    • parallel - process work with multiple threads

Example of parallel processing

await parEach(work, args, { concurrencyLimit: 10, parallel: true });

This was will spawn a thread for every logical CPU and split the work.

Performance

Sequential took 155.45 seconds
Batched took 16.04 seconds
Parallelized took 3.55 seconds

This was made for the article:

Kicking Node into high gear for data processing or how to hire 100 cats to catch a mouse

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].