[GHC] #13304: GHC 8.0.* is slow when run on Windows 10 Ubuntu subsystem

#13304: GHC 8.0.* is slow when run on Windows 10 Ubuntu subsystem -------------------------------------+------------------------------------- Reporter: sukhmel | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I have tried both 8.0.1 and 8.0.2 versions of GHC. 7.10.3 runs just fine. Installation process is also much faster for 7.10.3, later versions have taken around 4 hours to be installed. Programs compiled with slow GHC are also slow. Sample program: {{{#!haskell main = putStrLn "Hello, world!" }}} GHC is installed with Stack. Windows version is 1607 build 15031.0 I believe this could be a bug in implementation of Ubuntu subsystem, but I'm not quite sure what part of it is failing. {{{ $ time stack ghc -- -e 'putStrLn ""' real 2m28.240s user 0m0.375s sys 3m30.078s $ time stack ghc -- --version The Glorious Glasgow Haskell Compilation System, version 8.0.2 real 1m45.533s user 0m0.125s sys 2m46.516s time stack ghc --compiler ghc-8.0.1 -- --version The Glorious Glasgow Haskell Compilation System, version 8.0.1 real 2m54.764s user 0m0.234s sys 3m58.422s }}} {{{ $ time ghc -e 'putStrLn ""' real 0m0.872s user 0m0.109s sys 0m0.125s $ time ghc --version The Glorious Glasgow Haskell Compilation System, version 7.6.3 real 0m0.072s user 0m0.000s sys 0m0.031s time stack ghc --compiler ghc-7.10.3 -- -e 'putStrLn ""' real 0m0.876s user 0m0.234s sys 0m0.688s time stack ghc --compiler ghc-7.10.3 -- --version The Glorious Glasgow Haskell Compilation System, version 7.10.3 real 0m0.832s user 0m0.109s sys 0m0.813s }}} {{{ $ echo 'main = putStrLn "Hello, world!"' > test.hs $ time stack ghc --compiler ghc-8.0.2 -- test [1 of 1] Compiling Main ( test.hs, test.o ) Linking test ... real 3m56.582s user 0m0.609s sys 5m8.125s $ time ./test Hello, world! real 0m27.540s user 0m0.000s sys 0m27.297s }}} {{{ $ echo 'main = putStrLn "Hello, world!"' > test.hs $ time stack ghc --compiler ghc-7.10.3 -- test [1 of 1] Compiling Main ( test.hs, test.o ) Linking test ... real 0m2.222s user 0m0.406s sys 0m1.406s $ time ./test Hello, world! real 0m0.030s user 0m0.000s sys 0m0.031s }}} Part of Stack output with timings: {{{ $ stack ghc --verbose -- -e 'putStrLn "Hello, world!"' Version 1.3.2, Git revision 3f675146590da4f3edf768b89355f798229da2a5 (4395 commits) x86_64 hpack-0.15.0 ... 2017-02-19 21:13:05.756085: [debug] No project config file found, using defaults. 2017-02-19 21:13:05.759402: [debug] Run from outside a project, using implicit global project config 2017-02-19 21:13:05.761724: [debug] Using resolver: lts-8.0 from implicit global project's config file: /home/sukhmel/.stack/global- project/stack.yaml ... 2017-02-19 21:13:05.788855: [debug] Run process: /sbin/ldconfig -p 2017-02-19 21:13:05.816489: [debug] Process finished in 26ms: /sbin/ldconfig -p 2017-02-19 21:13:05.820648: [debug] Run process: /usr/bin/gcc -v 2017-02-19 21:13:05.844975: [debug] Process finished in 23ms: /usr/bin/gcc -v ... 2017-02-19 21:13:05.854997: [debug] Using standard GHC build 2017-02-19 21:13:05.856774: [debug] Getting global package database location ... 2017-02-19 21:13:05.867711: [debug] Run process: /home/sukhmel/.stack/programs/x86_64-linux/ghc-8.0.2/bin/ghc-pkg --no- user-package-db list --global 2017-02-19 21:13:05.888957: [debug] Run process: /home/sukhmel/.stack/programs/x86_64-linux/ghc-8.0.2/bin/ghc --numeric- version 2017-02-19 21:13:05.919968: [debug] Run process: /home/sukhmel/.stack/programs/x86_64-linux/ghc-8.0.2/bin/ghc-pkg --no- user-package-db field --simple-output Cabal version 2017-02-19 21:13:38.605653: [debug] Process finished in 32736ms: /home/sukhmel/.stack/programs/x86_64-linux/ghc-8.0.2/bin/ghc-pkg --no- user-package-db list --global 2017-02-19 21:14:11.930034: [debug] Process finished in 32792ms: /home/sukhmel/.stack/programs/x86_64-linux/ghc-8.0.2/bin/ghc-pkg --no- user-package-db field --simple-output Cabal version 2017-02-19 21:14:11.931071: [debug] Process finished in 32831ms: /home/sukhmel/.stack/programs/x86_64-linux/ghc-8.0.2/bin/ghc --numeric- version ... 2017-02-19 21:14:11.939817: [debug] Run process: /home/sukhmel/.stack/programs/x86_64-linux/ghc-8.0.2/bin/ghc -e "putStrLn \"Hello, world!\"" }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13304 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13304: GHC 8.0.* is slow when run on Windows 10 Ubuntu subsystem -------------------------------------+------------------------------------- Reporter: sukhmel | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by sukhmel): Also filed an issue to [https://github.com/Microsoft/BashOnWindows/issues/1713 BashOnWindows] issue tracker. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13304#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13304: GHC 8.0.* is slow when run on Windows 10 Ubuntu subsystem -------------------------------------+------------------------------------- Reporter: sukhmel | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): I assume stack is not necessary to reproduce this? Can you post reproduction instructions without it? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13304#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13304: GHC 8.0.* is slow when run on Windows 10 Ubuntu subsystem -------------------------------------+------------------------------------- Reporter: sukhmel | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by sukhmel): [comment:2 mpickering], here are the steps: 1. `wget http://downloads.haskell.org/~ghc/8.0.2/ghc-8.0.2-x86_64-deb8-linux.tar.xz` 2. `tar -xJf ghc-8.0.2-x86_64-deb8-linux.tar.xz` 3. `cd ghc-8.0.2` 4. `./configure --prefix=/tmp/ghc` 5. `make install` 6. `time /tmp/ghc/bin/ghc -e 'putStrLn ""'` -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13304#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13304: GHC 8.0.* is slow when run on Windows 10 Ubuntu subsystem -------------------------------------+------------------------------------- Reporter: sukhmel | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9706 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => invalid * related: => #9706 Comment: This is indeed a BashOnWindows bug. The original issue reported in comment:1 has been closed in favor of this one (https://github.com/Microsoft/BashOnWindows/issues/1671). In that thread, a BashOnWindows dev [https://github.com/Microsoft/BashOnWindows/issues/1671#issuecomment-27776485... notes]:
This is on our backlog but is unlikely to make the Creators Update. I know we're planning on looking at this soon though.
For some context, I've looked at what causes this slowdown. For some reason stack has mapped an mind-bogglingly huge region of memory (I'm talking dozens of terabytes). When we fork we walk the entire address range to set up the new process's state. We have a design that should vastly speed this up, but we're approaching "pencils down" date for Creators Update.
The "some reason" is #9706, which explains why this can't be reproduced in GHC 7.10. There's not much that GHC can do from its end (besides waiting for BashOnWindows to apply a fix), so I'm going to close this as invalid. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13304#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13304: GHC 8.0.* is slow when run on Windows 10 Ubuntu subsystem -------------------------------------+------------------------------------- Reporter: sukhmel | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9706 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by awson): Btw, is a disabled-large-address-space build maintained on 64-bit Linux? I planned to play with WSL when Creator's Update is out, but AFAIUI we won't see the fix there, so any GHC 8+ will be unusable on it. Thus I wonder what is the current state of disabled-large-address-space configuration on 64-bit Linux? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13304#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13304: GHC 8.0.* is slow when run on Windows 10 Ubuntu subsystem -------------------------------------+------------------------------------- Reporter: sukhmel | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9706 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by YitzGale): It is reported that you can compile GHC 8 using {{{./configure --disable-large-address-space}}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13304#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC