Here is patch against rev. 3706 of namespace branch:


Thanks to all for your assistance in tracking this down.

An additional issue has to be solved regarding the massive disposition of of qx.renderer.layout.HorizontalBoxLayoutImpl instances which slow down the start of my huge widget.


Sebastian Werner schrieb:
Looks great!

Could you please provide a patch. And please try to keep the old logic 
(disposer debug). I will add this to SVN as soon as I get your patch.

Sebastian


Dietrich Streifert schrieb:
  
Hello Everybody,

I'm posting it again because its maybe getting lost in the long thread 
before.

After some fiddeling I found this combination of the disposer methods to 
be about 5 times faster then the version in Object.js.

One change is that in the class method dispose there is just a call to 
dispose if the object has the attribute _disposed = false and the entry 
of the object in the _db array is nullyfied just in the dispose instance 
method not a second time in the dispose class method.

Another change was to do just assignments with null and not calling the 
delete operator.

Please have a look if I missed something here. If it is ok I'll be happy 
to provide a patch.

qx.core.Object.prototype.dispose = function() {
  if (this.getDisposed()) {
    return;
  }

  // Dispose user data
  if (this._userData)
  {
    for(var vKey in this._userData) {
      this._userData[vKey] = null;
    }

    this._userData = null;
  }

  // Finally cleanup properties
  if (this._objectproperties)
  {
    var a = this._objectproperties.split(qx.constant.Core.COMMA);
    var i, l;
    for (i=0, l=a.length; i<l; i++) {
      this[qx.OO.values[a[i]]] = null;
    }

    this._objectproperties = null;
  }

  // Delete Entry from Object DB
  //
  qx.core.Object._db[this._hashCode] = null;

  this._disposed = true;
}

qx.core.Object.dispose = function()
{
  var vObject;

  for (var i=qx.core.Object._db.length-1; i>=0; i--)
  {
    vObject = qx.core.Object._db[i];

    if (vObject != null && vObject._disposed === false )
    {
      vObject.dispose();
    }
  }
}

    


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
  

-- 
Mit freundlichen Grüßen
Dietrich Streifert
Visionet GmbH
Index: frontend/framework/source/class/qx/core/Object.js
===================================================================
--- frontend/framework/source/class/qx/core/Object.js   (revision 3706)
+++ frontend/framework/source/class/qx/core/Object.js   (working copy)
@@ -80,18 +80,17 @@
   // var logger = qx.dev.log.Logger.getClassLogger(qx.core.Object);
   // logger.debug("Disposing Application");
 
-  var vStart = (new Date).valueOf();
+  // var vStart = (new Date).valueOf();
   var vObject;
 
   for (var i=qx.core.Object._db.length-1; i>=0; i--)
   {
     vObject = qx.core.Object._db[i];
 
-    if (vObject != null)
+    if (vObject != null && vObject._disposed === false)
     {
       // logger.debug("Disposing: " + vObject);
       vObject.dispose();
-      qx.core.Object._db[i] = null;
     }
   }
 
@@ -384,10 +383,10 @@
   {
     var a = this._objectproperties.split(qx.constant.Core.COMMA);
     for (var i=0, l=a.length; i<l; i++) {
-      delete this[qx.OO.values[a[i]]];
+      this[qx.OO.values[a[i]]] = null;
     }
 
-    delete this._objectproperties;
+    this._objectproperties = null;
   }
 
   if (this.getSetting("enableDisposerDebug"))
@@ -410,7 +409,6 @@
 
   // Delete Entry from Object DB
   qx.core.Object._db[this._hashCode] = null;
-  delete qx.core.Object._db[this._hashCode];
 
   // Mark as disposed
   this._disposed = true;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to