Skip to content

Memory leak with simple vector code #60

@rpeszek

Description

@rpeszek

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions