Execution 3x to 5x faster for most applications compared to LB v4.5.1

Liberty BASIC v5.0 is designed to outperform previous versions.  Raw computational code benefits most and some GUI features may feel slightly slower, but on the average different kinds of applications will run noticeably faster.

Example benchmark:

    'sieveX10.bas
    'Updated version of sieve2.bas that runs 10 iterations.

    'Notice that arrays are globally visible to functions.
    'The sieve() function uses the flags() array.
    'This is a Sieve benchmark adapted from BYTE 1985
    ' May, page 286

    size = 7000
    dim flags(7001)
    for x = 1 to 10
        start = time$("ms")
        sieve = sieve(size)
        finish = time$("ms")-start
        print sieve; " primes found."
        print "End of iteration. Elapsed time in milliseconds: "; finish
        redim flags(7001)
    next x
    end

function sieve(size)
    for i = 0 to size
        if flags(i) = 0 then
            prime = i + i + 3
            k = i + prime
            while k <= size
                flags(k) = 1
                k = k + prime
            wend
            sieve = sieve + 1
        end if
    next i
end function


Sample runs

Liberty BASIC v4.5.1 on Windows 10 (avg 88.7 milliseconds)

1651 primes found.
End of iteration. Elapsed time in milliseconds: 95
1651 primes found.
End of iteration. Elapsed time in milliseconds: 110
1651 primes found.
End of iteration. Elapsed time in milliseconds: 77
1651 primes found.
End of iteration. Elapsed time in milliseconds: 81
1651 primes found.
End of iteration. Elapsed time in milliseconds: 95
1651 primes found.
End of iteration. Elapsed time in milliseconds: 74
1651 primes found.
End of iteration. Elapsed time in milliseconds: 89
1651 primes found.
End of iteration. Elapsed time in milliseconds: 94
1651 primes found.
End of iteration. Elapsed time in milliseconds: 79
1651 primes found.
End of iteration. Elapsed time in milliseconds: 93

Liberty BASIC v5.0 on Windows 10 (avg 18.3 milliseconds, or 4.8 times faster than v4.5.1)

1651 primes found.
End of iteration. Elapsed time in milliseconds: 56
1651 primes found.
End of iteration. Elapsed time in milliseconds: 12
1651 primes found.
End of iteration. Elapsed time in milliseconds: 16
1651 primes found.
End of iteration. Elapsed time in milliseconds: 15
1651 primes found.
End of iteration. Elapsed time in milliseconds: 14
1651 primes found.
End of iteration. Elapsed time in milliseconds: 14
1651 primes found.
End of iteration. Elapsed time in milliseconds: 13
1651 primes found.
End of iteration. Elapsed time in milliseconds: 14
1651 primes found.
End of iteration. Elapsed time in milliseconds: 15
1651 primes found.
End of iteration. Elapsed time in milliseconds: 14

Disclaimer: Performance measurements can vary on the same hardware when running Liberty BASIC on different versions of Windows, Mac OS, and Linux and between 32-bit and 64-bit versions of Liberty BASIC and operating systems.