Yep, it is caused by the "ondocumentchange", you can easily verify this:
In the "doDatapointer_withoutDestroy" method, remove the call to "setNodeAttribute()". Click on the "without destroy"-button, now everything works smoothly. But then click on the "with destroy"-button - CPU load is enormous, because of the still listening event-handlers from the "doDatapointer_withoutDestroy" method. q.e.d.

- André

As far as I can tell it iss just the  number of ondocumentchange handlers
keepsincreasing, one per datapointer, and it just takes time ,proportional
to the number of listeners, to send all of those events
when the dataset is modified.


On Wed, Sep 10, 2008 at 11:28 AM, Henry Minsky <hminsky at laszlosystems.com 
<http://www.openlaszlo.org/mailman/listinfo/laszlo-dev>>wrote:

>/
/>/  Anyone have a guess as to why the CPU load would increase when
/>/ datapointers' "destroy()" method is not called?  A new datapointer has some
/>/ delegates registered to it, but I don't
/>/ see why that would cause any noticable increase in CPU load. Would the
/>/ ondocumentchange handlers set by LzDataPointer.__LZTracking be causing this
/>/ much of a load?
/>/
/>/ Amy, Max
/>/
/>/ Attached a test case I would like to share with you. It is actaully a
/>/ general issue - happens on SWF8 too. It may be something you know and is
/>/ obvious to you, but to us was new.
/>/
/>/ Basically we saw (we think) that pointers to datasets must be destroyed -
/>/ else CPU gets eaten up. Test case attached. One test obtains pointers to a
/>/ dataset and destroys them immediately. Another obtains pointers to same
/>/ dataset but does not destroy them.
/>/
/>/ We believe the laszlo samples actually do not recommend to destroy - which
/>/ is why we are confused.
/>/
/>/ More details from Nasser's description below.
/>/
/>/ Gilad
/>/
/>/
/>/ Greetings
/>/ Attached the test case for data pointer with destroy and without destroy
/>/
/>/ you can notice the difference by eye.
/>/
/>/ click the first button " with destroy" and see how quick the counter. to
/>/ stop the test click the same button again
/>/
/>/ now click the second button 'without destroy" and see that the counter
/>/ speed is start quickly but will start to lose speed.
/>/
/>/
/>/
/>/ Best regards
/>/ Nasser
/>/
/>////

--
Henry Minsky
Software Architect
hminsky at laszlosystems.com 
<http://www.openlaszlo.org/mailman/listinfo/laszlo-dev>

Reply via email to