Opened 11 years ago

Closed 11 years ago

Last modified 3 years ago

#830 closed bug (fixed)

Compiler performance bug: large "do" expression

Reported by: simonmar Owned by:
Priority: normal Milestone: 6.6.1
Component: Compiler Version: 6.4.2
Keywords: Cc: ndmitchell@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


From Neil Mitchell:

Using GHC 6.4.2 on Windows and 6.4.1 on Linux, I get really poor compile time performance for large do blocks - for example:

main = do
  return ()
  return ()
  return ()

The following are the compile times in seconds for a given number of return () lines, GHC 6.4.1 on Linux, with a very beefy processor (my department server) and loads of RAM.

100    1.444
200    4.054
300    7.977
400    13.967
500    21.265
600    30.71
700    43.997

For comparison on my desktop machine I get out of heap space with 268Mb of heap, in a few minutes for 700. Compared to Hugs and Yhc, which both deal with all of these files instantly.

By splitting the 700 line do block into 7 separate do blocks, each 100 lines, I get a compile time of 8.530.

The particular reason I was running into this issue was with an auto generated file of tests, about 360 lines of reasonably lines in a do block, which exhausted the memory in GHCi. I have modified my test generator to split the files into 50 line blocks.



Change History (6)

comment:1 Changed 11 years ago by simonmar

Cc: ndmitchell@… added

comment:2 Changed 11 years ago by simonmar

Milestone: 6.6.1

comment:3 Changed 11 years ago by simonpj

Resolution: fixed
Status: newclosed

Excellent point. Fixed in the HEAD.

comment:4 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:5 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple

comment:6 Changed 3 years ago by Simon Marlow <simonmar@…>

Note: See TracTickets for help on using tickets.