Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CHRTRAN and remove characters
Message
De
14/10/2004 14:12:12
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Divers
Thread ID:
00950654
Message ID:
00951489
Vues:
7
>Considering that the second and third are in the "normal world" constrained to being the set of one instance of each possible characters, 256 for ASCII, your test is totally absurd.
>
>It's also an inaccurate measure of performance of chrtran() because you've mixed the replicate() time into the benchmark.
>
>>run this:
>>
>>CLEAR
>>SET ESCAPE ON
>>FOR n=12 TO 24
>>   lcStr = SPACE(2^n-32)
>>? 'lenght',LEN(lcStr)
>>    ltStart = seconds()
>>    lcX = chrtran( replicate( '*',  2^n-32), lcStr , lcStr )
>>?? seconds() - ltStart
>>next
>>
>>with a 256K string you have to kill the process.

>Considering that the second and third are in the "normal world" constrained to being the set of one instance of each possible characters, 256 for ASCII, your test is totally absurd.
>
>It's also an inaccurate measure of performance of chrtran() because you've mixed the replicate() time into the benchmark.
>
>>run this:
>>
>>CLEAR
>>SET ESCAPE ON
>>FOR n=12 TO 24
>>   lcStr = SPACE(2^n-32)
>>? 'lenght',LEN(lcStr)
>>    ltStart = seconds()
>>    lcX = chrtran( replicate( '*',  2^n-32), lcStr , lcStr )
>>?? seconds() - ltStart
>>next
>>
>>with a 256K string you have to kill the process.

David, i put replicate within the test because it is faster !
CLEAR
x=replicate( '*',  2^24-32)
t1=SECONDS()
 FOR k=1 TO 100
  =x
 NEXT
? 'variable',SECONDS()-t1

t1=SECONDS()
 FOR k=1 TO 100
   =replicate( '*',  2^24-32)
 NEXT
? 'replicate', SECONDS()-t1
Study and Abstraction, wants more study and abstraction.

End.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform