- Why does TI-BASIC program run faster when calculator unplugged than connected?
- 26 Jun 2024 05:43:32 pm
While comparing programs that generate prime number (divide by prior primes versus Sieve of Eratosthenes), I accidentally found out there a significant speed difference when running programs.
For example, running this TI-BASIC program on my TI-84+ CE Python unit:
Code:
It ran in 372 seconds when the calculator was not connected to anything, but 430 seconds when connected to my computer, but not doing anything with TI-connect at the time.
The same thing happened with my best version (so far) for the Sieve of Eratosthenes version:
While writing all of the above, it occurred to me that the reason the calculator runs slower while "charging" is that there is an app running in the background of the TI-84 even while TI-connect on the computer is idle.
For example, running this TI-BASIC program on my TI-84+ CE Python unit:
Code:
startTmr → S
{2, 3} → L₁
For(M, 5, 7907, 2)
1 → A
Lbl 1
A + 1 → A
L₁(A) → B
remainder(M, B)
if Ans and B² < M: Goto 1
if Ans: M → L₁(1 + dim(L₁))
End
Disp L₁, checkTmr(S), dim(L₁)
It ran in 372 seconds when the calculator was not connected to anything, but 430 seconds when connected to my computer, but not doing anything with TI-connect at the time.
The same thing happened with my best version (so far) for the Sieve of Eratosthenes version:
While writing all of the above, it occurred to me that the reason the calculator runs slower while "charging" is that there is an app running in the background of the TI-84 even while TI-connect on the computer is idle.