Item11405: massive performance issue in WorkflowPlugin (patch available)

pencil
Priority: Urgent
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: WorkflowPlugin
Branches: trunk
Reported By: MichaelDaum
Waiting For:
Last Change By: MichaelDaum
There's a commonTagsHandler that tries to expand WORKFLOW... preference variables on its own behalf. It therefore tries to find the control topic. When there's one it is cached internally, if not nothing is cached, even not the "no-such-control-topic" result. So control files are searched for over and over again for the same topic for no good reason.

--- lib/Foswiki/Plugins/WorkflowPlugin.pm       (revision 13546)
+++ lib/Foswiki/Plugins/WorkflowPlugin.pm       (working copy)
@@ -66,7 +66,10 @@
     ( $web, $topic ) = Foswiki::Func::normalizeWebTopicName( $web, $topic );
 
     my $controlledTopic = defined $rev ? $cache{"$web.$topic.$rev"} : undef;
-    return $controlledTopic if $controlledTopic;
+    if ($controlledTopic) {
+      return if $controlledTopic eq '_undef';
+      return $controlledTopic;
+    }
 
     if ( defined &Foswiki::Func::isValidTopicName ) {
 
@@ -110,7 +113,7 @@
         }
     }
 
-    $cache{"$web.$topic.$rev"} = $controlledTopic;
+    $cache{"$web.$topic.$rev"} = $controlledTopic || '_undef';
     return $controlledTopic;
 }

-- MichaelDaum - 04 Jan 2012

 
Topic revision: r3 - 10 Jan 2012, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy