Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ngot/parallel-calculate
MutiThread JS for fast calculation.
https://github.com/ngot/parallel-calculate
Last synced: about 1 month ago
JSON representation
MutiThread JS for fast calculation.
- Host: GitHub
- URL: https://github.com/ngot/parallel-calculate
- Owner: ngot
- Created: 2016-03-26T11:06:47.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-03-27T10:01:45.000Z (over 8 years ago)
- Last Synced: 2024-10-17T10:29:07.704Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 76.2 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# parallel-calculate
Yeah! That's right. MutiThread JS for fast calculation.# Benchmark
![](./benchmark/imgs/bench.png)# Usage
```js
const Calculator = require('parallel-calculate');
const calculator = new Calculator(path.join(__dirname, './test/support/worker.js'));
let result = calculator.proxy([1,2,3], 'plus');
```# APIs
parallel-calculate
### constructor(path, limits);
- path: @param {String} path to the worker file,must be absolute path.
- limits: @param {Number} optinal. Concurrency number.### proxy(datas, method)
- datas: @param {Array} datas to cal.must Array.
- method: @param {String} method want to invoke.
- @returns {Array} Returns the result processed by the method.# test
```
fibjs test/index.test.js
```# Attendtion
- You can only use this lib on [fibjs](https://github.com/xicilion/fibjs).It does not support Node.js.