Date: Sun Oct 18 02:07:03 MST 1998 From: Michael Douma <Michael.Douma@nist.gov> Subject: Testing CPU speedSemi-calibrated CPU speed testing
How do you test the CPU speed of your host computer? The following script was posted on Direct-L by Guy McLoughlin and many people have contributed their results. This script appears to run about a third faster in Dir. 5, and is never any faster on multiple processor machines.
This is useful for choosing what version of Quicktime movies to use. For example, the Sorenson codec produces much nicer quality than the CiniPak codec, but is highly CPU intensive, requiring at least a fast Pentium or PowerPC 603/604. [See more information on Quicktime Codecs from Terran Interactive.] The following Lingo uses the command "QuickTimeVersion" and requires the QuickTime 3 Asset Xtra with Dir. 6.5.
Lingo to choose whether to use Sorenson encoded Quicktime:
-- Should I use Sorenson or Cinipak movies?
global gSorenson -- whether to use Sorenson video
if QuickTimeVersion() >= 3 then -- if sorenson codec loaded
if SieveTest() < 25 then -- choose your own threshold
set gSorenson to TRUE
else
set gSorenson to FALSE -- QT 3 enabled, but processor too slow
end if
else
set gSorenson to FALSE
end if
The above code calls the SieveTest handler:
-- Sieve Benchmark Test
-- Summary of typical results in Dir 6 (shorter times are better) ...
-- MAC PowerMac 604e/180 --> 13 ticks
-- MAC PowerMac G3/266 to G3/300 ---> 5 to 7 ticks
-- PC Pentium 100 ---> 35 ticks
-- PC Pentium 200 to 233 ---> 14 to 20 ticks
-- PC Pentium II 266 to 350 ---> 5 to 6 ticks
on SieveTest
set SIZE = 8190
set FLAGS = []
repeat with n = 1 to SIZE
add(FLAGS,TRUE)
end repeat
set COUNT = 0
set Start = 0
startTimer
repeat with N = 1 to SIZE
if getAt(FLAGS,N) then
set PRIME = ((2 * N) + 3)
set K = (N + PRIME)
repeat while (K <= SIZE)<br>
setAt(FLAGS,K,FALSE)
set K = (K + PRIME)
end repeat
set COUNT = (COUNT + 1)
end if
end repeat
set Stop = the Timer
Return (Stop - Start)
end SieveTest
-----------------------------------------------------------------------
(This script is splightly modified from the original, it now returns a value.)