Vector package is heavily optimized with Core rewrite rules. This code executes in milliseconds and small amount of constant space in GHC:
import qualified Data.Vector as V
sq x = x * x
bigSumVec = V.sum $ V.map sq $ V.enumFromTo 1 (100000000 :: Int64)
But in Eta it runs forever and eventually produces OutOfMemory exception. I have looked at the patch for vector and I did not see any aggressive removal of {# RULES ... #}.
Is this a case of something special that Eta currently does?
I believe that all vector package optimization is in the Core layer and am surprise at such a big difference.
Thank you for any help answering this question.
Vector package is heavily optimized with Core rewrite rules. This code executes in milliseconds and small amount of constant space in GHC:
But in Eta it runs forever and eventually produces OutOfMemory exception. I have looked at the patch for vector and I did not see any aggressive removal of
{# RULES ... #}.Is this a case of something special that Eta currently does?
I believe that all vector package optimization is in the Core layer and am surprise at such a big difference.
Thank you for any help answering this question.