Re: Cabal: Can only one processor core be used?

Volker Wysk <[email protected]>
Newsgroups gmane.comp.lang.haskell.cafe
Message-ID <[email protected]>
Am Dienstag, dem 02.04.2024 um 13:38 +0200 schrieb Henning Thielemann:
> On Tue, 2 Apr 2024, Volker Wysk wrote:
> 
> > I've searched the web and the cabal user guide on how to use more processor
> > cores for compilation via cabal. I couldn't find anything.
> 
> $ cabal install -j3
> 
> or
> 
> $ fgrep jobs ~/.cabal/config
> jobs: 3
> 
> 
> > Cabal compilation times can be a pain. It can't be that you can use only 
> > one processor core with cabal, can it ..?
> 
> There are two places where you can increase the use of multiple cores. The 
> one above controls the number of packages to be compiled in parallel, 
> whereas
> 
> $ cabal install --ghc-option=-j3
> 
> means that each instance of GHC compiles up to three modules in parallel.

This sounds better than compiling only whole packages in parallel.

> As far as I know it is currently not possible to interleave compilation of 
> modules and packages. I.e. optimally we would only need one 'jobs' option 
> and then Cabal and GHC manage to fill the working queue with any module 
> from any package. This would certainly require to run GHC in a server 
> mode.
> 
> 
> However, without a fast storage for temporary files you will hardly see an 
> actual speedup. I use to mount a ram disk with tmpfs at /ram and then 
> compile with
> 
> $ cabal install -j3 --ghc-option=-j3 --builddir=/ram/cabal

That's important. And so you're saying that an SSD isn't fast enough.
So I'll probably set up a RAM disk as well.

Thanks

Volker
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.