Skip to content

Cabal startup is slow #1841

Closed
Closed
@nh2

Description

@nh2

I just run the almost-noop command: time cabal build asdf

cabal: Unknown build target 'asdf'.   
There is no component 'asdf' or module 'asdf'.
cabal build asdf  3.82s user 0.08s system 99% cpu 3.903 total

What is cabal doing in these 4 seconds?

When I run time cabal build asdf -v3, I get the output

Using internal setup method with build-type Simple and args:
["build","--verbose=3","--builddir=dist","--jobs=1","asdf"]

after 2 seconds, and then the rest of the output after another 2 seconds.

I also noticed that this time seems to grow the longer I make the build-depends section in my cabal file.

What is going on behind the scenes, and can we make this no-op time faster?

This startup time seems to add to all cabal build commands; it is especially painful for builds with nothing to do, where the penalty is quite high versus the actual time needed to compile: A no-op build only takes 6.8 seconds for me.

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