Author Topic: Different execution speed between Clickpad and Touchpad  (Read 4533 times)

0 Members and 1 Guest are viewing this topic.

Offline Deathrider

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 13
  • Rating: +0/-0
    • View Profile
Different execution speed between Clickpad and Touchpad
« on: May 02, 2012, 06:50:58 am »
Hi all,

I have two calculators: a Ti nSpire CAS Touchpad and a TI nSpire CAS Clickpad.
All of them have the last OS 3.1.0.392
I want investigate if they have the same execution speed so I wrote a simple program with the embeded editor. This program request as input a resistor value in ohm and gives as output the nearest combination of two resistors. I have wrote the program in way that it makes many for and while cycles and execute for 20~30 seconds before give an output. I have execute this program on the two calcultator and I have find that the Clickpad one is ~3-5 seconds faster than the clickpad one.

Why????

I think that the touchpad one have to spend some time in the touch part of the hardware.

I am right? What You think?

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Different execution speed between Clickpad and Touchpad
« Reply #1 on: May 02, 2012, 07:06:31 am »
You should not use long for and while loops, that can give unexpected results as Lua programs are intented to be event based. Indeed, it might be part of the touch handling. (interrupts of the touchpad might break the lua execution some times).
Now, try to do it a different way. Use timer.getMilliSecCounter to get time different between just a couple of operations, and see what that gives :)

Offline Deathrider

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 13
  • Rating: +0/-0
    • View Profile
Re: Different execution speed between Clickpad and Touchpad
« Reply #2 on: May 02, 2012, 08:15:45 am »
I am not programming with Lua. I am using the editor embedded into the calculator. I think it is Ti Basic or something similar. I am using long for and while cycles in order to magnify the differences in the execution speed. I am not searching for optimize the code. I just wanted to see the differencies between the two calculators with the same OS but different hardware.

Question: I have to refresh my libraries everytime i make a mod to the source code of my program. What do exacltly the refresh? It seems to be a compilation...

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Different execution speed between Clickpad and Touchpad
« Reply #3 on: May 02, 2012, 04:14:25 pm »
Oh sorry, though Lua :P

Well, I suppose it can be because of the touchpad interrupts. They will interrupt the program flow multiple times, making it go slower.
But I am not sure. I wonder if there is a way to disable them and then test again.

Regarding the other question, I think libraries are duplicated somewhere, as they still work when you delete them. Not sure about that, but I think something like this might be the case. 

Offline Deathrider

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 13
  • Rating: +0/-0
    • View Profile
Re: Different execution speed between Clickpad and Touchpad
« Reply #4 on: May 03, 2012, 06:02:52 am »
I remember from my TI-86 (now dead) that I have to compile my programs before they can be used. If I do not compile a modified program, the old version still work. I think there is something similar in the nspire: the classical compile procedure produce an executable stored somewhere and working even if you cancel the source. I hope someone can explain this.

Offline northern_snow

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 132
  • Rating: +17/-1
    • View Profile
Re: Different execution speed between Clickpad and Touchpad
« Reply #5 on: May 11, 2012, 09:14:34 am »
I think you should make sure that the voltage of the batteries in two calculators are the same. That may influence the result.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Different execution speed between Clickpad and Touchpad
« Reply #6 on: May 11, 2012, 09:44:42 am »
Could it be that you ran another BASIC prog with a loop in it recently? I remember back in 2010 I ran a program that kept looping and afterward my calc lagged like crazy, like a computer running some process that takes 100% of the CPU.