Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Side by side comparison (strings & local data)
Message
De
29/12/2003 10:19:38
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
29/12/2003 10:13:15
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
00861648
Message ID:
00862499
Vues:
47
Walter,
When saying twice as fast you were comparing to 'Fputs' version shown here, right ? If so this is not the one timing 7-9 secs. It was first draft to beat the original C# code :) The one I'm saying fast uses "set fields to .. " and "copy to ..." (in my 1st post to Nick as I remember).
Cetin

>Hi Cetin,
>
>Very strange, there must be something else. because every test I do seems to indicate that my version is about twice as fast. I'll post the two programs I use.
>
>
SET SAFETY OFF
>
>SELECT * FROM h:\ids5\dbfs\t_tanklayout INTO CURSOR TESTcursor READWRITE
>StartTime = SECONDS()
>
>=AFIELDS(laFields, "Testcursor")
>
>cString = Chr(13) + Chr(9) + "<CLIENT>" + Chr(13)
>FOR nT = 1 TO ALEN(laFields,1)
>	cString = m.cString + Chr(9) + Chr(9) + ;
>           "<"+laFields(nT,1)+">%%"+laFields(nT,1)+"%%</"+;
>           laFields(nT,1)+">" + Chr(13)
>ENDFOR
>cString = cString + Chr(9) + "</CLIENT>"
>
>SET TEXTMERGE DELIMITERS TO "%%","%%"
>SET TEXTMERGE TO "cxml.txt" noshow
>SET TEXTMERGE ON
>
>\\<TEST>
>SCAN
>	TEXTMERGE(m.cString)
>ENDSCAN
>\</TEST>
>
>SET TEXTMERGE OFF
>SET TEXTMERGE TO
>
>cXml = FILETOSTR("cxml.txt")
>?SECONDS() - StartTime
>
>and your version.
>
>
>SET SAFETY OFF
>
>SELECT * FROM h:\ids5\dbfs\t_tanklayout INTO CURSOR TEST READWRITE
>
>StartTime = SECONDS()
>=AFIELDS(laFields, "Test")
>
>lcTemp = Sys(2015)+'.tmp'
>lnHandle = fcreate(lcTemp)
>Fputs(m.lnHandle,'<TEST>')
>SCAN
>	Fputs(m.lnHandle,"<CLIENT>")
>	FOR f = 1 TO ALEN(laFields, 1)
>		Fputs(m.lnHandle,"<" + laFields(m.f, 1) + ">" + ;
>			TRANSFORM(EVALUATE("Test." + laFields(m.f, 1))) +;
>			"</" + laFields(m.f, 1) + ">")
>	ENDFOR
>	Fputs(m.lnHandle,"</CLIENT>")
>ENDSCAN
>Fputs(m.lnHandle,"</TEST>")
>Fclose(m.lnHandle)
>lcXML = FileToStr(m.lcTemp)
>*Show Time-Taken
>Erase (m.lcTemp)
>?SECONDS() - StartTime
>
>
>I'm curious what does make the difference..
>
>Walter,
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform