Repository : ssh://darcs.haskell.org//srv/darcs/haddock

On branches: development,master

http://hackage.haskell.org/trac/ghc/changeset/b50695a86358fd02b9a0ececbc107bf5274d5f95

>---------------------------------------------------------------

commit b50695a86358fd02b9a0ececbc107bf5274d5f95
Author: David Waern <[email protected]>
Date:   Sat Oct 1 01:55:45 2011 +0200

    Merge in darcs patch:
    
      Joachim Breitner <[email protected]>**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.

>---------------------------------------------------------------

 src/Haddock/Backends/Xhtml.hs |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/Haddock/Backends/Xhtml.hs b/src/Haddock/Backends/Xhtml.hs
index 600a536..b639760 100644
--- a/src/Haddock/Backends/Xhtml.hs
+++ b/src/Haddock/Backends/Xhtml.hs
@@ -41,6 +41,7 @@ import System.FilePath hiding ( (</>) )
 import System.Directory
 import Data.Map              ( Map )
 import qualified Data.Map as Map hiding ( Map )
+import qualified Data.Set as Set hiding ( Set )
 import Data.Function
 import Data.Ord              ( comparing )
 
@@ -415,9 +416,11 @@ ppHtmlIndex odir doctitle _maybe_package themes
 
     getIfaceIndex iface =
       [ (getOccString name
-         , Map.fromList [(name, [(mdl, name `elem` instVisibleExports 
iface)])])
+         , Map.fromList [(name, [(mdl, name `Set.member` visible)])])
          | name <- instExports iface ]
-      where mdl = instMod iface
+      where
+        mdl = instMod iface
+        visible = Set.fromList (instVisibleExports iface)
 
     indexElt :: (String, Map GHC.Name [(Module,Bool)]) -> HtmlTable
     indexElt (str, entities) =



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to