Skip to content

Improve compilation time #458

@konsumlamm

Description

@konsumlamm

I was wondering if it is possible to improve the compilation time for vector. On my machine, compiling it from scratch currently takes about 1.5 minutes (1 m 35 s), which I feel like is too long. For comparison, containers takes 45 seconds and unordered-containers takes 23 seconds. Yes, I know, cabal caches the build, but it's still annoying (you still have to compile it when switching to a new GHC version, contributing to vector, in CI, when non-Haskell people want to install a tool using vector,...).

Some ideas that might help to decrease compilation time:

  • disable implicit fusion (Is vector susceptible to the same fusion problems as text? #457)
  • split vector into several smaller packages (e.g. vector-core, vector-storable, vector-unboxed), so that users only have to depend on the parts they actually use (vector would stay the same, so people could just keep using it)
  • don't use -O2 (find out which flags significantly improve performance and only enable those)
  • reduce inlining (this is probably hard without also reducing performance)
  • avoid redefinitions for specialization (this would be a breaking change, but idk how big the impact would be)

I'm curious how realistic you find my ideas and if you have other ideas to improve compilation time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions