You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the recently merged #13712 causes a performance regression. Inline iterators are intended for speed, we shouldn't introduce un-necessary copies. /cc @krux02
Example
block:
let n =10_000_0000var s =newSeq[int](n)
procp2(): varseq[int] = s
iteratorip1(v: openArray[int]): auto=yield v[0]
yield v[^1]
import times
let t =cpuTime()
for i in0..<100:
for x inip1(p2()):
doAssert x !=-1echocpuTime() - t
Current Output
12.171379 # seconds
Expected Output
7.000000000034756e-06 # seconds, before that PR, eg with nim 1.0.6
Well I even put a comment about this performance problem in the code. So this is nothing new. I would have been nicer if this would have been complained ahead of time. But I guess performance is ranked higher than correctness in this particular case.
the recently merged #13712 causes a performance regression. Inline iterators are intended for speed, we shouldn't introduce un-necessary copies. /cc @krux02
Example
Current Output
12.171379 # seconds
Expected Output
7.000000000034756e-06 # seconds, before that PR, eg with nim 1.0.6
Possible Solution
EDIT: the revert has been done in #13728
Additional Information
The text was updated successfully, but these errors were encountered: