Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP and .NET Data Comparison
Message
From
16/01/2006 09:39:15
 
 
To
15/01/2006 14:53:33
Dorin Vasilescu
ALL Trans Romania
Arad, Romania
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
01080965
Message ID:
01087136
Views:
48
Hi Dorin,

Thks for your code. This results still sound much better then
those that Terry reported in his message.

Cannot test it myself (still with VFP6)
but something puzzled me here ...

Folowing part ;

*
nSeconds=seconds()  

*********************************Part of your code
.
LOCAL cSchemaXML, cTempCursorName
cTempCursorName = SYS(2015)
oCollection = NEWOBJECT('Collection')
SELECT * FROM (cCursor) WHERE RECNO() = 0 INTO CURSOR ( cTempCursorName  )
CURSORTOXML(cTempCursorName ,'cSchemaXML',1,1,1,"1")

nSeconds = seconds() - nSeconds   &&my insertion


.
.
*********************************
nSeconds = ???

How long does it take ?











>Hi, pardon me for jumping in
>I have some code that copies the cursor into one collection and back
>Some timings, strange I might say, with 2500 rows
>
oCollection = cursor2collection('cAlias','cKeyField')
>1st run = 1.266 seconds
>2ns run = 2.641 seconds
>3rd and subsequent = 0.141 seconds
>
>
collection2cursor(oCollection, 'cAlias')
>
>about 0.062 seconds, constant
>
>
>The code
>
>PROCEDURE cursor2collection( cCursor, cKeyField )
>#DEFINE trimCharColumns		.F.
>
>_t = SECONDS()
>
>LOCAL cSchemaXML, cTempCursorName
>cTempCursorName = SYS(2015)
>oCollection = NEWOBJECT('Collection')
>SELECT * FROM (cCursor) WHERE RECNO() = 0 INTO CURSOR ( cTempCursorName  )
>CURSORTOXML(cTempCursorName ,'cSchemaXML',1,1,1,"1")
>ADDPROPERTY(oCollection,'CursorSchema',cSchemaXML)
>oCharColumnsCol = NEWOBJECT('Collection')
>SELECT (cCursor)
>i=0
>iFieldCount = AFIELDS(aFlds)
>FOR c=1 TO iFieldCount
>	IF TYPE(aFlds[c,1]) $ 'C,M'
>		oCharColumnsCol.Add(aFlds[c,1])
>	ENDIF
>NEXT
>
>i=0
>SCAN
>	i = i + 1
>	oCollection.Add(NEWOBJECT('Empty'),TRIM(EVALUATE(cKeyField)))
>	oObj = oCollection.Item(i)
>	SCATTER NAME oObj ADDITIVE
>	IF trimCharColumns
>		FOR c=1 to oCharColumnsCol.Count
>			cFldName = oCharColumnsCol.Item(c)
>			oObj.&cFldName = TRIM(oObj.&cFldName)
>		NEXT
>	ENDIF
>ENDSCAN
>?'Cursor 2collection',SECONDS() - _t, ' sec'
>RETURN oCollection
>
>
>
>****************************************************
>PROCEDURE collection2cursor(oCollection,cCursorname)
>
>_t = SECONDS()
>
>LOCAL oRow,i
>XMLTOCURSOR(oCollection.CursorSchema,cCursorname)
>SELECT (cCursorName)
>FOR i=1 TO oCollection.Count
>	oRow = oCollection.Item(i)
>	APPEND BLANK
>	GATHER NAME oRow
>NEXT
>?'Collection 2 cursor', SECONDS() - _t, ' sec'
>
>
>
>
>>
>>Hi Terry :)
>>It seem that is not all that simple as I tought and wrote in my message ??
>>Did not mean to trouble anyone :( I tought wld be just 5 minutes job to test speed of cursortoxml() with some dummy 2500 records cursor.
>>
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform