#4387: Huge executables with GHC 7
----------------------------------+-----------------------------------------
Reporter: daniel.is.fischer | Owner: igloo
Type: bug | Status: new
Priority: highest | Milestone: 7.0.1
Component: Compiler | Version: 7.1
Keywords: executable size | Testcase:
Blockedby: | Difficulty:
Os: Linux | Blocking:
Architecture: x86 | Failure: Other
----------------------------------+-----------------------------------------
Comment(by daniel.is.fischer):
And I just have found a small testcase.
It's the vector package,
{{{
module Main (main) where
import System.Environment (getArgs)
import qualified Data.Vector.Unboxed as U
import System.Random
import Control.Monad
main :: IO ()
main = do
args <- getArgs
let num = case args of
(a:_) -> read a
_ -> 20
-- create a new source of randomness
-- andan infinite list of randoms
g <- getStdGen
let rs = randoms g
mapM_ print $ take num (rs :: [Int])
-- fill a vector with the first 10 random Ints
-- let a = U.fromList (take num rs) :: U.Vector Int
--
-- -- print the sum
-- print (U.sum a)
--
-- -- print each element
-- forM_ (U.toList a) print
}}}
produces a 29179534 byte executable. If you comment out the (unused!)
import of Data.Vector.Unboxed, it's a fairly normal 1081701 bytes.
With 6.12.3, I have vector-0.6.0.2, HEAD includes vector-0.7, so it could
well be the vector package and not GHC. Let me try out, won't be too long.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4387#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs