Comparisons
Compare ciorent with other concurrency libraries.
Concurrency control
Section titled “Concurrency control”Control the amount of tasks running concurrently.
- Bundle size: 998B
- Minified size: 518B
- Gzipped size: 346B
import { semaphore } from 'ciorent';import { setTimeout } from 'node:timers/promises';
const sem = semaphore.init(2);const asyncTask = async () => { await semaphore.acquire(sem); await setTimeout(5); semaphore.release(sem);};
for (let i = 0; i < 100; i++) asyncTask();
- Bundle size: 3.03KB
- Minified size: 1.41KB
- Gzipped size: 724B
import { limitFunction } from 'p-limit';import { setTimeout } from 'node:timers/promises';
const asyncTask = limitFunction( async () => { await setTimeout(5); }, { concurrency: 2 },);
for (let i = 0; i < 100; i++) asyncTask();
- Bundle size: 942.05KB
- Minified size: 203.87KB
- Gzipped size: 65.24KB
import { Effect } from 'effect';
Effect.runPromise( Effect.all(new Array<Effect.Effect<void>>(100).fill(Effect.sleep(5)), { concurrency: 2, }),);