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
Scala Native 0.4.0-M2 on Scala 2.11 was able to optimize Range loops as while loops.
During the years something got lost.
If you try the example on that version it takes the same time as its equivalent while loop.
EDIT:
The example optimizes correctly on current Scala Native with Scala 2.12 and Scala 2.13.
So this issue happens only on Scala 3.
(lolgab, thanks for discovering this. I hope I do not offend you by making the issue more visible.)
Oops!
This is a pretty serious regression.
I know that I have written all sorts of code all over Scala Native
using for-range loops (not range.foreach) with the believe that this optimization was occurring.
Probably even in the PRs I submitted and/or prepared over the recent holidays.
Probably high double digits of instances or more.
javalib and posixlib are probably strongly affected by this regression.
The text was updated successfully, but these errors were encountered:
The root cause is a bug in Scala 3 that doesn't use the specialized variant of foreach in Range: scala/scala3#19759
The optimization in #4139 does optimize it regardless of the missing specialization.
As reported by lolgab in issue #4132
(lolgab, thanks for discovering this. I hope I do not offend you by making the issue more visible.)
Oops!
This is a pretty serious regression.
I know that I have written all sorts of code all over Scala Native
using
for-range
loops (not range.foreach) with the believe that this optimization was occurring.Probably even in the PRs I submitted and/or prepared over the recent holidays.
Probably high double digits of instances or more.
javalib and posixlib are probably strongly affected by this regression.
The text was updated successfully, but these errors were encountered: