Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculate Estimated Time Of Indexing
Message
 
To
30/06/2005 13:23:08
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01027589
Message ID:
01028325
Views:
11
OK, I'm still a little lost so you'll need to help me with this...

I understand that the Latency Accurate is the Average of all calls and I also get that the standard deviation stuff you put in (I mean, I know what STD is). While I can see the usefulness to accuracy of getting the average (and even touched on that topic in my blog), here's my questions...

What does the standard deviation tell us that is useful in diagnosing the execution speed of the program? I mean, I could see using something like this to throw out the elements that have a deviation that is much greater than the norm and then reaveraging what is left. This would increase the accuracy of our average by getting rid of any wild swings (out of bounds values). But I don't see how your use of it applies... I'm sure it does, I just don't understand it.

Perhaps my first question is related to my being unable to comprehend the following...

?"Then the precision is 1/" + TRANSFORM( ROUND(lnTicksPerSecond/SDev,0))

...what are you showing here? I mean I can see that you are taking the TicksPerSecond and dividing it by the STD, but I don't see how that relates to precision.

Any clarification you can give me would be much appreciated.


>>If you are trying to see how long your index code is taking to run you could use one of the methods described in my blog post today...
>>
>>http://www.sweetpotatosoftware.com/SPSBlog/PermaLink.aspx?guid=acb41ee7-bb3d-41a0-8574-044b6527ff4b
>>
>
>Hi Craig,
>You can also consider the latency of the call and the error of the measure;
>with this the precision sensitively reduces him.
>
>
>CLEAR
>FOR i = 1 TO 10000000
>*!* Burn in
>ENDFOR
>
>SET DECIMALS TO 18 && maximum number of places********* USING SECONDS() **************
>LOCAL lcBuffer1, lcBuffer2, lnTicksPerSecond, lnCurrentTickCount
>DECLARE INTEGER QueryPerformanceFrequency IN kernel32 STRING @lpFrequency
>DECLARE INTEGER QueryPerformanceCounter IN kernel32 STRING @lpPerformanceCount
>lcBuffer1 = SPACE(8)
>lcBuffer2 = SPACE(8)
>=QueryPerformanceFrequency(@lcBuffer1)
>lnTicksPerSecond = buf2num(SUBSTR(lcBuffer1, 1,4)) + buf2num(SUBSTR(lcBuffer1, 5,4)) * 2^32
>DIMENSION testN(10000,2)
>FOR I=1 TO ALEN(testN,1)
>	=QueryPerformanceCounter(@m.lcBuffer1 )
>	=QueryPerformanceCounter(@m.lcBuffer2 )
>
>	testN(m.i,1) = m.lcBuffer1
>	testN(m.i,2) = m.lcBuffer2
>NEXT
>CREATE CURSOR latency (start Q(8),stop Q(8))
>APPEND FROM ARRAY testN
>SELECT ((buf2num(SUBSTR(stop, 1,4)) - buf2num(SUBSTR(start , 1,4)));
>					+ (buf2num(SUBSTR(stop, 5,4)) - buf2num(SUBSTR(start, 5,4))) * 2^32) callTime;
>	FROM latency INTO CURSOR latency ORDER BY 1
>BROWSE NOWAIT
>
>CALCULATE AVG(callTime),STD(callTime),MAX(callTime),MIN(callTime) TO average,SDev,MaxDev,MinDev
>
>? "HR Performance counter accurate to 1/" + TRANSFORM(lnTicksPerSecond) + " of a second"
>? "Latency Accurate: "	,round(average,0)
>? "  St. Deviation "	,round(SDev,0)
>? " Max deviation"		,round(MAX(MaxDev-average,average-MinDev),0)
>
>? "Then the precision is 1/" + TRANSFORM( ROUND(lnTicksPerSecond/SDev,0))
>************************
>FUNCTION buf2num(tcBuffer)
>************************
>    RETURN ASC(SUBSTR(tcBuffer, 1,1)) + ;
>        ASC(SUBSTR(tcBuffer, 2,1)) * 2^8 + ;
>        ASC(SUBSTR(tcBuffer, 3,1)) * 2^16 + ;
>        ASC(SUBSTR(tcBuffer, 4,1)) * 2^24
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform