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:

   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.
As I noted at the end of my original message, I now realize that the probable answer is that there is an app running in the background on the TI-84 that still runs even while TI-connect on the computer is idle.

Also, I do realize that while a TI-BASIC program is executing, the calculator is not charging.

Postscript:

An e-mail from TI-Cares, received after I wrote the above, agrees:

Quote:
When the TI-84 Plus CE is connected to a computer via the USB port, the operating system detects the connection and periodically checks for activity at the USB port. Checking for USB activity occurs in the background and the behavior is not configurable by the user.
I think you got it! From my understanding, the calculator is kinda always talking to the computer a little bit when it is able to. Did you test it with just charging the calculator from a non-computer usb port? I would expect that it wouldn't slow down at all in that situation (unless I'm completely wrong)
DaniNyaaa wrote:
I think you got it! From my understanding, the calculator is kinda always talking to the computer a little bit when it is able to. Did you test it with just charging the calculator from a non-computer usb port? I would expect that it wouldn't slow down at all in that situation (unless I'm completely wrong)


I tested it charging it from a USB power strip (no data at all), it still ran slower.
OldTimeProgrammingNerd wrote:
DaniNyaaa wrote:
I think you got it! From my understanding, the calculator is kinda always talking to the computer a little bit when it is able to. Did you test it with just charging the calculator from a non-computer usb port? I would expect that it wouldn't slow down at all in that situation (unless I'm completely wrong)


I tested it charging it from a USB power strip (no data at all), it still ran slower.


I think TI-OS just has a background thread that activates if the usb port is connected that listens for any incoming connection requests. The eZ80 chip, being not exactly powerful, shows a noticeable performance impact due to that, especially in the more performance-sensitive TI-Basic. Just my guess though.
The calculator doesn't have threads, but there probably are periodic USB interrupts that look kind of like a thread if you squint.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement