ParallelArray - JavaScript 编辑
The goal of ParallelArray
was to enable data-parallelism in web applications. The higher-order functions available on ParallelArray
attempted to execute in parallel, though they may fall back to sequential execution if necessary. To ensure that your code executes in parallel, it is suggested that the functions should be limited to the parallelizable subset of JS that Firefox supports.
语法
new ParallelArray() new ParallelArray([element0, element1, ...]) new ParallelArray(arrayLength, elementalFunction)
ParallelArray instances
属性
- length
- Reflects the number of elements in the
ParallelArray
.
方法
- map
- reduce
- scan
- scatter
- filter
- flatten
- partition
- get
示例
Using map in parallel
var p = new ParallelArray([0, 1, 2, 3, 4]);
var m = p.map(function (v) {
return v + 1;
});
参见
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论