This isn't in any way a complete answer, but from within your project
directory, you can use `stack exec -- ghc` to compile individual main
modules, and play around with different profiling settings. My guess here
is that -prof-auto it inserting cost centers in such a way that GHC isn't
able to inline things, but that's very much a guess.

On Mon, Nov 28, 2016 at 12:48 AM John Ky <newho...@gmail.com> wrote:

> Hello everyone,
>
> I have this problem where enabling profiling using stack undoes stream
> fusion and I’d like to do my profiling with stream fusion intact.
>
> The following reproduces my problem:
>
> $ git clone g...@github.com:haskell-works/hw-tutorial-performance.git
> $ cd hw-tutorial-performance/
> $ stack init
> $ stack build --executable-profiling
> $ time $(find .stack-work/dist/ -type f -name hw-tutorial-performance-rwhe) 
> 1e7
> 5000000.5
>
> real    0m4.432s
> user    0m3.484s
> sys    0m0.936s
>
> $ rm -rf .stack-work/
> $ stack build
> $ time $(find .stack-work/dist/ -type f -name hw-tutorial-performance-rwhe) 
> 1e7
> 5000000.5
>
> real    0m0.034s
> user    0m0.018s
> sys    0m0.013s
>
> With profiling, my program taks over 4 seconds to run. Without profiling,
> it only takes 0.034 seconds.
>
> I believe the problem to be that stream fusion has been disabled by stack.
>
> Does anyone know how to prevent this from happening?
>
> Cheers,
>
> -John
> ​
>
> --
> You received this message because you are subscribed to the Google Groups
> "haskell-stack" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to haskell-stack+unsubscr...@googlegroups.com.
> To post to this group, send email to haskell-stack@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/haskell-stack/238e95ac-d9f9-4569-88a3-eedd5ab9b2a8%40googlegroups.com
> <https://groups.google.com/d/msgid/haskell-stack/238e95ac-d9f9-4569-88a3-eedd5ab9b2a8%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"haskell-stack" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to haskell-stack+unsubscr...@googlegroups.com.
To post to this group, send email to haskell-stack@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/haskell-stack/CAKA2JgKENUw%3DxcRsX9FZWo%3D%2BJ0DPhZ9yDEcOo8e2-pCjfNJJbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to