Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CHRTRAN and remove characters
Message
From
14/10/2004 14:12:12
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00950654
Message ID:
00951489
Views:
6
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform