Two things happened in close succession: (1) got a BIOS update from Dell, for my Core i7 6700, and (2) installed the latest QB64 development build, which does something different with numbers. Whatever the cause, the speed measured by my number-crunching speed test went way the heck up. Any ideas?
Original speed, for the three groups of tests, using the 64-bit QB64, averaged roughly 1.0. 1.8, and 2.3 seconds.
Then Dell updated the BIOS, to defend against a couple of viruses whose names I forget. Weird names. We were warned that this BIOS update would reduce performance. Now the times averaged something like 1.5, 2.3, and 3.4. Disappointing, in that this is what the 32-bit QB64 had measured previously, more or less.
So last night, after the new BIOS and new QB64 64-bit development build, I said hey, let's measure again. Imagine my surprise, when the speeds now measured about 0.12, 0.22, and 0.33 seconds! Whoa. Wha'happened? An order of magnitude faster?
In case you want to do the test yourselves, this is the program I used. It's a program to compute prime numbers, repurposed as a number-crunching speed test. Just really curious to know what changed.
Rem PRIME NUMBER GENERATOR SPEED TEST
Rem
Rem The program bypasses 2, starting with 3 as the first prime. It then
Rem increments the number (num) by 2 each iteration, and tests if it's a
Rem prime.
Rem
Rem The prime test consists of trying to divide the number, num, by all odd
Rem numbers beginning with 3 (ptest). This works because by starting with
Rem the smallest odd numbers, all primes factors less than ptest will
Rem already have been tested when a larger non-prime number is used in
Rem ptest. For example, ptest = 3 will have been attempted before ptest = 9.
Rem ptest = 3 would have divided evenly into num before ptest = 9 is tried.
Rem
Rem -------
Dim Shared i As _Float, num As _Float, ptest As _Float, prime As _Float, PrimeOld As _Float
Dim Shared MaxPrime As _Float, TimeStart As _Float, TimeEnd As _Float, TestNo, restart
Call init
TestNo = 1
3 If TestNo >= 1 And TestNo <= 5 Then MaxPrime = 100000
If TestNo > 5 And TestNo <= 10 Then MaxPrime = 150000
If TestNo > 10 And TestNo <= 15 Then MaxPrime = 200000
If TestNo >= 16 Then End
Call ReTest
1 Call StopRun
If restart = 1 GoTo 3
Rem -------
Rem If ptest > sqr(num), and no successful integer division came before, num
Rem must be prime. Increment num and start again with ptest = 3.
Rem -------
quot = num / ptest
If ptest > Sqr(num) Then
prime = num
Call PrintOut
num = num + 2
ptest = 3
GoTo 1
End If
Rem -------
Rem If ptest divides evenly into num, then num cannot be prime. Increment
Rem num and start again with ptest = 3.
Rem -------
If quot = Int(quot) Then
num = num + 2
ptest = 3
GoTo 1
End If
Rem -------
Rem As long as num / ptest is not integer and ptest <= sqr(num), continue
Rem trying with larger odd values of ptest.
Rem -------
ptest = ptest + 2
GoTo 1
End
Sub init
_Title "Prime Number Speed Test"
Screen _NewImage(120, 43, 0)
Color 1, 7
Cls
Print " SPEED TEST"
Print
Print "Speed test uses prime number generator program. Generator starts with 3."
Print "Max value of prime to be generated limits test duration. For this speed"
Print "test, the first 5 tests limit the max prime attempted to the first prime"
Print "past 100,000, the next 5 tests limit to the first prime past 150,000,"
Print "the last 5 tests limit to the first prime past 200,000."
Print
Print "While program is running, you can press <esc> to stop program."
Print
End Sub
Sub ReTest
restart = 0
TimeStart = Timer
prime = 1
num = 3
PrimeOld = 1
i = 2
ptest = 3
End Sub
Sub PrintOut
i = i + 1
PrimeOld = prime
End Sub
Sub StopRun
If InKey$ = Chr$(27) Then End
If prime >= MaxPrime Then
TimeEnd = Timer
ElapsedTime = Abs(TimeEnd - TimeStart)
Print "Test #"; TestNo; " Highest prime reached"; prime; " Seconds to reach value ="; ElapsedTime
restart = 1
TestNo = TestNo + 1
If TestNo = 6 Then Print
If TestNo = 11 Then Print
End If
End Sub