Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object destruction
Message
From
02/02/2014 12:09:32
Walter Meester
HoogkarspelNetherlands
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 8
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Web
Miscellaneous
Thread ID:
01592795
Message ID:
01592939
Views:
44
>>>BTW, I can simply fool the user by displaying a text like 'Processing 02-02-2014' in each Destroy() of the object that has info of the day. But it's even better to remove with the speed of the addition, which takes less that 2 seconds even if it is a whole year. This addition speed is surprisingly fast because it implies a quite complex processing of a table with info about an employee's working shift times.
>>
>>Did you try to use a method that removes all the objects with an explicit "RemoveObject()" call, rather than relying on native behaviour when the form is destroyed? This method would be better to monitor with set cover as you can see how much time each and every object removal takes.
>
>Yep, see my first message. Using removeobject() improved performance. Native: 55s, my code 25s. However, I removed only some of the objects. My later test drilled down and did a remove starting at the 'youngest' (child) level and ending at the nearly 'oldest' (parent) level. It resulted in 55s. I might try to do the collection phase (which takes a significant part of the processing time) at the init phase....

It indeed might have to do with the fact that there are objects with references to other objects. Can you split up the destoy in two phases? First remove all references to other objects, and only then remove all the objects. Measure the time to do both and draw your conclusion.

Are you using one (or few) specific property for references to other objects? If so, consider using THIS.Setall("MypropertyUsedForObjectReferences", NULL)
Also if you are using collections, and FOR EACH . use the FOXOBJECT clause. This really makes a difference

Walter,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform