Skip to content

toLinear breaks optimizations #17

@ulysses4ever

Description

@ulysses4ever

This has been an issue for a while (previous encounters recorded in #4). Take a look at a profiling build (profiling: True in cabal.project.local) at a12c2df:

cabal run benchrunner -- 1 "Mergesort" Seq 10000 +RTS -pj

(Mergesort is known to suffer more from it but others don't avoid it either). Here's how time profiling looks around get2/size2/setLin with toLinear:

Image

and without it (have to turn the linear arrow -. into the regular arrow -> instead of the linear one -- just fix the definition in Linear/Common.hs):

Image

(the pictures are created by speedscope.app: just upload benchrunner.prof that you get from the above cabal run there).

So, for instance, get2 takes 8 ms vs. 3 ms total time to mergesort a 10K array. This is crazy!

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceRelated to our performance

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions