Module: nagvis
Branch: master
Commit: d0638c6fe60229f37775aac9006a8a3f429bd416
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=d0638c6fe60229f37775aac9006a8a3f429bd416

Author: LaMi <[email protected]>
Date:   Thu Apr  1 01:53:21 2010 +0200

Some more performance improvements

---

 share/server/core/classes/objects/NagVisObject.php |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/share/server/core/classes/objects/NagVisObject.php 
b/share/server/core/classes/objects/NagVisObject.php
index 0f51c58..2bb9d15 100644
--- a/share/server/core/classes/objects/NagVisObject.php
+++ b/share/server/core/classes/objects/NagVisObject.php
@@ -48,6 +48,7 @@ class NagVisObject {
        protected $label_show;
        
        private static $sSortOrder = 'asc';
+       private static $arrDenyKeys = null;
        
        /**
         * Class constructor
@@ -242,13 +243,17 @@ class NagVisObject {
       return $this->fetchObjectAsChild();
                
                // Need to remove some options which are not relevant
-               $arrDenyKeys = Array('CORE' => '', 'BACKEND' => '', 'MAPCFG' => 
'',
-                       'MAP' => '', 'GRAPHIC' => '', 'conf' => '', 'services' 
=> '',
-                       'fetchedChildObjects' => '', 'childObjects' => '', 
'parentObjects' => '',
-                       'members' => '', 'objects' => '', 'linkedMaps' => '');
+               // FIXME: Would be much better to name the needed vars explicit
+               if(self::$arrDenyKeys == null) {
+                       self::$arrDenyKeys = Array('CORE' => '', 'BACKEND' => 
'', 'MAPCFG' => '',
+                               'MAP' => '', 'GRAPHIC' => '', 'conf' => '', 
'services' => '',
+                               'fetchedChildObjects' => '', 'childObjects' => 
'', 'parentObjects' => '',
+                               'members' => '', 'objects' => '', 'linkedMaps' 
=> '', 'isSummaryObject' => '',
+                               'isView' => '', 'dateFormat' => '', 
'arrDenyKeys' => '');
+               }
                
                foreach($this AS $key => $val) {
-                       if(!isset($arrDenyKeys[$key])) {
+                       if(!isset(self::$arrDenyKeys[$key])) {
                                $arr[$key] = $val;
                        }
                }
@@ -372,10 +377,11 @@ class NagVisObject {
     
                // If there are some members fetch the information for them
                if(isset($arr['num_members']) && $arr['num_members'] > 0) {
-                       $arr['members'] = Array();
+                       $members = Array();
                        foreach($this->getSortedObjectMembers() AS $OBJ) {
-                               $arr['members'][] = $OBJ->fetchObjectAsChild();
+                               $members[] = $OBJ->fetchObjectAsChild();
                        }
+                       $arr['members'] = $members;
                }
                
                return $arr;


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to