nitdoc: cache `concern_rank`
authorAlexis Laferrière <alexis.laf@xymus.net>
Thu, 28 Aug 2014 16:07:07 +0000 (12:07 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Thu, 28 Aug 2014 16:07:48 +0000 (12:07 -0400)
Improve performance of nitdoc by 60 times in some cases!

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/model_utils.nit

index bc8d2cb..51c643c 100644 (file)
@@ -34,7 +34,7 @@ redef class MConcern
 end
 
 redef class MProject
-       redef fun concern_rank do
+       redef fun concern_rank is cached do
                var max = 0
                for mgroup in mgroups do
                        var mmax = mgroup.concern_rank
@@ -87,7 +87,7 @@ redef class MGroup
                return res
        end
 
-       redef fun concern_rank do
+       redef fun concern_rank is cached do
                var max = 0
                for mmodule in collect_mmodules do
                        var mmax = mmodule.concern_rank
@@ -201,7 +201,7 @@ redef class MModule
                return res
        end
 
-       redef fun concern_rank do
+       redef fun concern_rank is cached do
                var max = 0
                for p in in_importation.direct_greaters do
                        var pmax = p.concern_rank