Ticket #4801 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

Typechecker performance regression 6.12 -> 7.0.1

Reported by: simonmar Owned by: simonpj
Priority: high Milestone: 7.0.2
Component: Compiler (Type checker) Version: 7.0.1
Keywords: Cc: verdelyi@…, cheecheeo@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty:
Test Case: perf/compiler/T4801 Blocked By:
Blocking: Related Tickets:

Description

The attached module is a smaller version of the example in #4505.

With GHC 6.12.3 it takes 4s to compile (x86_64/Linux), whereas with 7.0.1 it takes 282s. HEAD seems about the same as 7.0.1.

Attachments

LongList.hs Download (13.7 KB) - added by simonmar 2 years ago.

Change History

Changed 2 years ago by simonmar

Changed 2 years ago by verdelyi

  • cc verdelyi@… added

Changed 2 years ago by cheecheeo

  • cc cheecheeo@… added

Changed 2 years ago by simonmar

  • owner set to simonpj

Latest results:

6.12.3:

   1,411,847,696 bytes allocated in the heap
  Total time    4.56s  (  5.31s elapsed)

HEAD (20101221):

   8,229,161,760 bytes allocated in the heap
 Total time    6.30s  (  6.78s elapsed)

So the immediate problem has been fixed, although the compiler is still allocating about 6 times as much memory as 6.12.3 on this example. Ordinary profiling would probably nail the culprit of that.

We need to merge whatever patch(es) fixed the main problem into the 7.0.2 branch. Simon - which were they?

Changed 2 years ago by chak

Unfortunately, there is a similarly serious performance regressions in the type checker still present: #4856

Changed 2 years ago by simonpj

  • status changed from new to closed
  • testcase set to perf/compiler/T4801
  • resolution set to fixed

This (long-list) regression is certainly fixed. The HEAD is faster than 6.12.3. I've added a performance test to keep it that way.

Wed Jan 12 06:56:04 PST 2011  simonpj@microsoft.com
  * Major refactoring of the type inference engine
  
  This patch embodies many, many changes to the contraint solver, which
  make it simpler, more robust, and more beautiful.  But it has taken
  me ages to get right. The forcing issue was some obscure programs
  involving recursive dictionaries, but these eventually led to a
  massive refactoring sweep.

I'll look at #4856 separately, but am closing this one.

Simon

Note: See TracTickets for help on using tickets.