0.1.2 • Published 5 years ago

fastdash v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

fastdash

GitHub stars

multithreaded utility functions for node using worker threads

Please ★ this repo if you found it useful ★ ★ ★

Features

  • supports typescript
  • customize max threads

Benchmarks

map benchmarks

These benchmarks were performed on a server with 8 cores to show the contrast between multithreaded and single threaded node processing.

A function calculates prime numbers to simulate a workload.

map()CPU IntensiveCPU Nonintensive
fastdash2741.328177 ms322.372878 ms
lodash10367.716365 ms0.271168 ms

fastdash is multithreaded and is faster than lodash for CPU intensive tasks.

Screenshot from 2019-03-26 03-26-49

lodash is single threaded and is slower than fastdash for CPU intensive tasks.

Screenshot from 2019-03-26 03-28-00

lodash is faster than fastdash for tasks that are not CPU intensive.

Installation

npm install --save fastdash

Dependencies

Usage

Iteratee callback functions must be pure functions

map

import fast from 'fastdash';

async main() {
  const result = await fast.map([1, 2, 3], item => {
    return item + 1;
  });
  console.log(result); // [2, 3, 4]
}

main();

Support

Submit an issue

Screenshots

Contribute a screenshot

Contributing

Review the guidelines for contributing

License

MIT License

Jam Risser © 2019

Changelog

Review the changelog

Credits

Support on Liberapay

A ridiculous amount of coffee ☕ ☕ ☕ was consumed in the process of building this project.

Add some fuel if you'd like to keep me going!

Liberapay receiving Liberapay patrons