Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best Practices
Message
De
08/02/2013 12:08:47
Mike Sue-Ping
Cambridge, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01565478
Message ID:
01565501
Vues:
87
>>I saw some benchmarks and newobject() was slower by quit a bit.
>>But as vfp is nota language to be used with throwaway classes and objects like dotnet and java,
>>that difference should still be minimal - as long as forms are still read as complete vcx and not built in code.
>>
>>But if objects are created in a tight loop, I'd stay away from newobject().
>>
>>>Instanciating a class will always use memory. How come NEWOBJECT () is different ?
>>>
>>>>It will take more time to newobject() because memory has to be allocated. However, as fast as computers are today, I don't think you'll notice the difference.
>>>>
>>>>You could also go a hybrid route and use a class factory. The class factory would load the classlib or procedure as needed, then just keep a reference to it. That way, things are only loaded if needed, but kept after that.
>
>Yes, I've found NEWOBJECT is a LOT slower. If it's in a loop, or needs to be called from any of they Dynamic* stuff in a grid you'll want to stay away from it.

Thanks. Good to know this cause I actually have code calling newobject in a small scan loop. Currently I don't have any issues with it, however, I'm curious to know if changing it will get better performance.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform