Here's a nice one.
I have created a global function which I use in stead of CountFields:
FastCountFields(txt as string, txtsep as string) as integer
Dim i, j as integer
i=0
j=instrb(txt,txtsep)
while j>0
i=i+1
j=instrb(j+1,txt,txtsep)
wend
Return i
End Function
On OSX I found it on average to be about 25% faster than CountFields, on
Windows(XP) however, it is on average 300% faster.
In DebugRun on OSX the method was acually slower than CountFields.
Interesting sidenote: just for laughs I also tested ElfDataFields from
Theo's ElfData plugin. It is on average 100 times faster than
countfields. that's 10,000% faster folks.
Ronald Vogelaar
http://www.rovosoft.com
Charles Yeomans wrote:
On Feb 28, 2005, at 8:28 AM, Thomas Reed wrote:
On Feb 28, 2005, at 2:35 AM, Massimo Valle wrote:
I used microseconds to calculate the timing and I continue to get
about 3x
speed on if-then. Using ticks I get larger difference: 9x
That doesn't make any sense... Why should the timing method you use
influence the total speed of the test code? I would think this means
there's something wrong with the test or the calculations somewhere.
Because the act of calling Microseconds or Ticks affects the code in
which it's called. There is a lot of stuff going on at the processor
level, most of which I don't understand, that affects execution speed.
--------------
Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|