-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Labels
enhancementNew feature or requestNew feature or requestperformanceSomething is too slowSomething is too slow
Description
The generic for
loop is very slow when simply iterating over a range of integers — see benchmarking results in #163.
Automatically analyzing the loop header for patterns like for i := 0; i < n; i++
is hard, both because it requires an infinite lookahead in the parser and because n
is allowed to change during the iteration.
We could have a highly optimized for
loop version similar to that used in Go since 1.22:
for i in n { // 0 to n - 1
foo(i)
}
or
for i in m..n { // m to n - 1
foo(i)
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestperformanceSomething is too slowSomething is too slow