Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Source Control
Message
From
06/09/2005 13:40:19
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
06/09/2005 09:52:45
General information
Forum:
Visual FoxPro
Category:
Project manager
Title:
Miscellaneous
Thread ID:
01045693
Message ID:
01047097
Views:
25
>Thanks for the idea, Mike. That may be the route we take. Our primary app is in Mere Mortals, for better or for worse, which means we have dozens of VCX's already. Do you have any idea if there are any performance issues in the executables if we were to expand this to say 100 VCX's? Your idea could work well for us.

I would not break out the MM original classes. That would make a huge mess if a new version comes out. Any of your subclasses are good candidates.

I can't think of a better way to demonstrate the negligible impact of more classlibs than to combine subclassing with either a single classlib or multiple ones.
CLEAR ALL
CLOSE ALL

LOCAL m.lcOldSafety
m.lcOldSafety = SET("SAFETY")
SET SAFETY OFF
*Define a single classlib with several layers of inherited classes
*and contrast the performance against several classlibs with
*individual layers of subclasses.

*Classlib.vcx
*txt1
*txt11
*txt111
*txt1111

*versus
*classlib1.vcx
*txt1

*classlib11.vcx
*txt11

*classlib111.vcx
*txt111

*classlib1111.vcx
*txt1111

*Create the first txt1 in classlib.vcx

CREATE CLASSLIB CLASSLIB.VCX

KEYBOARD "{ctrl+w}" plain
CREATE CLASS txt1 OF classlib.vcx as textbox

KEYBOARD "{ctrl+w}" plain
CREATE CLASS txt11 OF classlib.vcx as txt1 FROM classlib.vcx

KEYBOARD "{ctrl+w}" plain
CREATE CLASS txt111 OF classlib.vcx as txt11 FROM classlib.vcx

KEYBOARD "{ctrl+w}" plain
CREATE CLASS txt1111 OF classlib.vcx as txt111 FROM classlib.vcx

*Establish a baseline. This exercises VFP's inheritance
*of the init method.
SET CLASSLIB TO classlib.vcx
LOCAL lnSeconds, lnI
lnSeconds=SECONDS()
FOR m.lnI = 1 TO 10000
  lotxtInstance = CREATEOBJECT("txt1")
  lotxtInstance = .NULL.
ENDFOR m.lnI
?SECONDS()-m.lnSeconds

*Now instanciate the lowest level subclass.
SET CLASSLIB TO classlib.vcx
LOCAL lnSeconds, lnI
lnSeconds=SECONDS()
FOR m.lnI = 1 TO 10000
  lotxtInstance = CREATEOBJECT("txt1111")
  lotxtInstance = .NULL.
ENDFOR m.lnI
?SECONDS()-m.lnSeconds

SET CLASSLIB TO

CREATE CLASSLIB CLASSLIB1.VCX
CREATE CLASSLIB CLASSLIB11.VCX
CREATE CLASSLIB CLASSLIB111.VCX
CREATE CLASSLIB CLASSLIB1111.VCX

KEYBOARD "{ctrl+w}" plain
CREATE CLASS txt1 OF classlib1.vcx as textbox

KEYBOARD "{ctrl+w}" plain
CREATE CLASS txt11 OF classlib11.vcx as txt1 FROM classlib1.vcx

KEYBOARD "{ctrl+w}" plain
CREATE CLASS txt111 OF classlib111.vcx as txt11 FROM classlib11.vcx

KEYBOARD "{ctrl+w}" plain
CREATE CLASS txt1111 OF classlib1111.vcx as txt111 FROM classlib111.vcx

*Establish a baseline. This exercises VFP's inheritance
*of the init method.
SET CLASSLIB TO classlib1.vcx
LOCAL lnSeconds, lnI
lnSeconds=SECONDS()
FOR m.lnI = 1 TO 10000
  lotxtInstance = CREATEOBJECT("txt1")
  lotxtInstance = .NULL.
ENDFOR m.lnI
?SECONDS()-m.lnSeconds

*Now instanciate the lowest level subclass.
SET CLASSLIB TO classlib1111.vcx
LOCAL lnSeconds, lnI
lnSeconds=SECONDS()
FOR m.lnI = 1 TO 10000
  lotxtInstance = CREATEOBJECT("txt1111")
  lotxtInstance = .NULL.
ENDFOR m.lnI
?SECONDS()-m.lnSeconds

SET CLASSLIB TO

SET SAFETY &lcOldSafety
CLEAR ALL
My results were that a first great-grandparent superclass took .894 seconds to instantiate 10,000 times. The great-grandchild subclass from the same classlib took 1.064 seconds for 10,000.

The great-grandparent from the first classlib took .922 seconds and the great-grandchild from a 4th classlib took 1.073 seconds.

I maintain high granularity, high cohesion, low coupling and eliminate developer contention and pay virtually nothing in terms of performance.


>
>Thanks,
>
>David
>
>>Hi David
>>
>>I've been struggling with exactly the issues you're looking at now. My solution is to significantly reduce the number of classes per vcx and the number of functions/procedures per PRG to near one-to-one.
>>
>>No two developers then ever work on the same atomic piece. There are also no contention issues and no extra steps to take.
>>
>>I still use source control, but only as a backup, not as a way to attempt to resolve conflicts or merge code.
>>
>>>Christoff,
>>>
>>>Thank you for your repsonse. Have you had any corruption issues with this technique? How well does the merging work? How much overhead is this in terms of your time?
>>>
>>>Thanks,
>>>
>>>David
>>>
>>>>You can download my tool from ftp://foxpert.homeip.net/twofox.zip. Call GenXML to create the XML files for all binary files, call GenCode to convert all XML files back to code. The process in CVS is:
>>>>
>>>>- run GenXML
>>>>- update sandbox from repository
>>>>- solve conflicts
>>>>- run GenCode
>>>>- test application
>>>>- commit modified XML files
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform