parallel-processing - 运行 N 个函数与 1 个组合函数
问题描述
在下面的视频Thinking Parallel Programming中,Guy Steele 最后推荐了提高代码性能的方法
他在 1:01 左右提到,如果你有一个状态 s 和函数数组 f[i],那么与其做
for i <- 1 to n; s = f[i](s)
做
fcomposed(s) where fcomposed is the composition of all functions in f[i]
我在这里看不到任何好处。我误解了什么吗?
解决方案
推荐阅读
- module - Odoo 10:在 odoo 启动时自动安装自定义模块
- javascript - React - 从 API 调用创建对象并存储在一个大对象中
- apache - 使用 mod_authnz_ldap 公开组信息
- html - Angular Material Table - 将动态背景颜色应用于一行(Angular 2+)
- join - 如何使用实体框架结合嵌套交叉连接和左连接
- java - dropzone.js - 将目录和文件上传到 Spring MVC
- c++ - 使用带有 boost-parameter 的初始化列表
- python - 如何为每个拆分执行命令?
- pandas - 为什么我得到一个 SettingWithCopyWarning 一个值正试图在一个切片的副本上设置?
- excel - 在 MS Excel 工作表中并排分离两个表格