Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Side by side comparison (strings & local data)
Message
De
28/12/2003 01:37:49
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
27/12/2003 17:08:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
00861648
Message ID:
00862316
Vues:
25
>Hi Dragan,
>
>If you want to pull the neck to the turtle, you can use EXECSCRIPT().
>
>I compare these :
>
>* A)
>SCAN
>	lcXML = m.lcXML + "<CLIENT>"
>	FOR f = 1 TO FCOUNT()
>		lcXML = m.lcXML + "<" + FIELD(m.f) + ">" + ;
>			TRANSFORM(EVALUATE(FIELD(m.f))) +;
>			"</" + FIELD(m.f) + ">"
>	ENDFOR
>	lcXML = m.lcXML + "</CLIENT>"
>ENDSCAN
>
>* B)
>Set Textmerge to memvar lcText noshow
>Set Textmerge delimiters to "|"
>Set Textmerge on
>\local lcXml,f
>\	lcXML ="<CLIENT>"
>	FOR f = 1 TO FCOUNT()
>\		lcXML = m.lcXML + "<|FIELD(m.f)|>" +	TRANSFORM(|FIELD(m.f)|) + "</|FIELD(m.f)|>"
>	ENDFOR
>\	lcXML = m.lcXML + "</CLIENT>"
>\return m.lcXml
>Set Textmerge to
>StrToFile(m.lcText, "runner.prg")
>Compile runner.prg
>SCAN
>	lcXML = m.lcXML + runner()
>ENDSCAN
>
>* C)
>SET TEXTMERGE DELIMITERS TO "|"
>SET TEXTMERGE TO MEMVAR sCommand NOSHOW
>SET TEXTMERGE ON
>\ SCAN
>\ lcXML = m.lcXML + "<CLIENT>" ;
>FOR f = 1 TO FCOUNT()
>	\ + "<|FIELD(m.f)|>" + TRANSFORM(|FIELD(m.f)|) + "</|FIELD(m.f)|>" ;
>NEXT
>\ + "</CLIENT>"
>\ ENDSCAN
>SET TEXTMERGE TO
>=EXECSCRIPT(M.sCommand )
>
>* 1000 cycles for a 132791 string result from a VCX table
>* A :  66 comp/s
>* B : 107 comp/s
>* C : 175 comp/s
>
>
>Fabio

OK, so for a small table (how many records can a vcx have, hundreds?), the overhead of creating a script or a prg is significant. Now how about something that will create a 2, 4, 8... megabytes of string? Since you already have the stuff put together, how about just using a bigger table? I'm really curious.

Not that I will always go for the fastest solution - quite often it will be the stabler or easier to maintain - but I'd like to know what's the slowest, to stay away from it as far as I can.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform