[Haskell-cafe] Very _very_ slow compiles on Windows 10

23 views
Skip to first unread message

Nicu Ionita

unread,
Sep 16, 2016, 6:11:06 PM9/16/16
to haskel...@haskell.org
Is anybody else experiencing really slow compilations with GHC 7.10.2 on Windows 10?

I use stack to compile the project and run it under a mingw64 environment provided by Github bash. The CPU usage is very low all the time (meaning: GHC does barely use the CPU). On same computer with Ubuntu 16.04 it just compiles normally, but under Windows it is for sure 10x slower, maybe even more.

Nicu

A.M.

unread,
Sep 16, 2016, 9:20:50 PM9/16/16
to haskel...@haskell.org
Are you using virtualization? I see the same thing under virtualbox on
Ubuntu. Specifically, even after allocating 12 real CPUs to the VM, I
never see stack-invoked ghc use more than one CPU. On rare occasions,
the linker phase hangs. I have confirmed that ghc reports 12 capabilities.

I'm just glad that Windows is not my primary development platform; it's
entirely possible that virtualization is the cause. VirtualBox is not
known for being a speed demon, but the compilation speed is indeed
embarrassing.

Cheers,
M


signature.asc

Nicu Ionita

unread,
Sep 17, 2016, 2:05:08 AM9/17/16
to haskel...@haskell.org
No virtualisation, it is a dual boot maschine.
1 CPU would be good :-) In my case it is a very small fraction of it.
Nicu

------ Originalnachricht ------
Gesendet: 17.09.2016 03:20:38
Betreff: Re: [Haskell-cafe] Very _very_ slow compiles on Windows 10

Malcolm Wallace

unread,
Sep 17, 2016, 2:44:48 AM9/17/16
to Nicu Ionita, haskel...@haskell.org
Do you have Symantec Endpoint Protection or similar antivirus? We found that under certain paranoid settings, even  "ghc --version"  took upwards of seven seconds, and compilation was slowed by a couple of orders of magnitude. We think the AV was scanning the (large) compiler binary, plus any DLLs it loads, plus the source, interface, and object files read and generated, On every invocation. Linking was absolutely dog slow.  We also think the AV was deliberately throttled to never use more than 10% of CPU time, to avoid being noticeable to the user.

It is possible that there are AV settings you can tweak to avoid the paranoia, and trust the compiler, and any other file that has already been scanned once.

 Regards,
    Malcolm (iPhone)
_______________________________________________
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.

Nicu Ionita

unread,
Sep 17, 2016, 3:14:28 AM9/17/16
to haskel...@haskell.org
Sorry, I forgot to answer to all...

------ Originalnachricht ------
Von: "Nicu Ionita" <nicu....@acons.at>
An: "Malcolm Wallace" <malcolm...@me.com>
Gesendet: 17.09.2016 09:12:30
Betreff: Re[2]: [Haskell-cafe] Very _very_ slow compiles on Windows 10

Oh, this could be a good hint! I don't have other protection except windows defender, which is own Windows AV. (Reviews suggest that this should be enough, altough on other PC - not with Windows 10 - I use different AVs) But maybe the Windows own AV exhibits the same behaviour. I will check this, thanks!
Nicu

------ Originalnachricht ------
Von: "Malcolm Wallace" <malcolm...@me.com>
An: "Nicu Ionita" <nicu....@acons.at>
Gesendet: 17.09.2016 08:44:30

Phyx

unread,
Sep 17, 2016, 3:56:39 AM9/17/16
to haskel...@haskell.org, nicu....@acons.at
> Is anybody else experiencing really slow compilations with GHC 7.10.2 on
> Windows 10?


The issue is that the entire Windows support in GHC Is mostly provided through POSIX support.
Windows however isn't a POSIX system, and these APIs were implemented for compatibility and not performance.

This is the reason why any I/O operation on GHC Windows will be significantly slower. This is the same reason why Console I/O is also much slower. Why Unicode support is a bit wonky etc.

GHC Is currently just not using native Windows syscalls, because by large most developers of GHC don't use Windows.

There are other issues (but I won't go in detail on the user list). We are trying to fix this, there are multiple tickets open such as https://ghc.haskell.org/trac/ghc/ticket/11394 but it's a big task and there are very limited resources so priority is given to things currently broken rather than just slow.

Nicu Ionita

unread,
Sep 17, 2016, 9:14:49 AM9/17/16
to haskel...@haskell.org
Yes, this is it!

I deactivated Windows Defender real time protection mode, then I compiled again: normal compilation times.

Thanks for the hint!
Nicu

------ Originalnachricht ------
Von: "Nicu Ionita" <nicu....@acons.at>
Gesendet: 17.09.2016 09:14:18
Reply all
Reply to author
Forward
0 new messages