Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge in darcs patch:

  Joachim Breitner <mail@joachim-breitner.de>**20110619201645
  Ignore-this: f6c51228205b0902ad5bfad5040b989a

  As reported on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578301,
  generating the global index takes much too long if type-level (with lots of
  auto-generated types) is installed. The patch avoids a quadratic runtime in the
  subfunction getIfaceIndex of ppHtmlIndex by using a temporary set. Runtime improvement observed here from 25.36s to 2.86s.
  • Loading branch information...
commit b50695a86358fd02b9a0ececbc107bf5274d5f95 1 parent b4915e8
David Waern authored October 01, 2011

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. 7  src/Haddock/Backends/Xhtml.hs
7  src/Haddock/Backends/Xhtml.hs
@@ -41,6 +41,7 @@ import System.FilePath hiding ( (</>) )
41 41
 import System.Directory
42 42
 import Data.Map              ( Map )
43 43
 import qualified Data.Map as Map hiding ( Map )
  44
+import qualified Data.Set as Set hiding ( Set )
44 45
 import Data.Function
45 46
 import Data.Ord              ( comparing )
46 47
 
@@ -415,9 +416,11 @@ ppHtmlIndex odir doctitle _maybe_package themes
415 416
 
416 417
     getIfaceIndex iface =
417 418
       [ (getOccString name
418  
-         , Map.fromList [(name, [(mdl, name `elem` instVisibleExports iface)])])
  419
+         , Map.fromList [(name, [(mdl, name `Set.member` visible)])])
419 420
          | name <- instExports iface ]
420  
-      where mdl = instMod iface
  421
+      where
  422
+        mdl = instMod iface
  423
+        visible = Set.fromList (instVisibleExports iface)
421 424
 
422 425
     indexElt :: (String, Map GHC.Name [(Module,Bool)]) -> HtmlTable
423 426
     indexElt (str, entities) =

0 notes on commit b50695a

Please sign in to comment.
Something went wrong with that request. Please try again.