Repository navigation
Commit f88ccc9
committed
Visit an arrow's argument types without a closure
Why:
`iter_type_expr` visited the argument types of a `Tarrow` with
`List.iter (fun {typ} -> f typ)`, which allocates a closure each time
it reaches an arrow type. Many walks over types go through it
(copying, marking, levels, occur checks), and function types are
common.
The arguments are now visited by a recursive function that takes `f`.
The order of the visits is unchanged.
Measured with scripts/compilerBenchmarks.js against the previous commit:
allocated words -0.22% in total (-0.20% for the files compiled one by
one, -0.24% in the builds of tests/tests), stress/NestedClosures.res
-0.89%. On a 552 module React app (clean build, one domain) the build
allocates 0.18% fewer words.
Signed-off-by: Jono Prest <jjprest@gmail.com>1 parent b82d944 commit f88ccc9
2 files changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
243 | 250 | | |
244 | 251 | | |
245 | 252 | | |
246 | 253 | | |
247 | | - | |
| 254 | + | |
248 | 255 | | |
249 | 256 | | |
250 | 257 | | |
| |||
0 commit comments