Deathrider
LV1 Newcomer (Next: 20)
Offline
Last Login: 20 May, 2013, 20:13:33
Date Registered: 02 May, 2012, 12:10:07
Posts: 13
Topic starter
Total Post Ratings: 0
|
 |
« on: 02 May, 2012, 12:50:58 » |
0
|
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?
|
|
|
|
|
Logged
|
|
|
|
Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
Offline
Gender: 
Last Login: Yesterday at 22:53:52
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733
Total Post Ratings: +180
|
 |
« Reply #1 on: 02 May, 2012, 13:06:31 » |
0
|
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 
|
|
|
|
|
Logged
|
|
|
|
Deathrider
LV1 Newcomer (Next: 20)
Offline
Last Login: 20 May, 2013, 20:13:33
Date Registered: 02 May, 2012, 12:10:07
Posts: 13
Topic starter
Total Post Ratings: 0
|
 |
« Reply #2 on: 02 May, 2012, 14:15:45 » |
0
|
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...
|
|
|
|
|
Logged
|
|
|
|
Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
Offline
Gender: 
Last Login: Yesterday at 22:53:52
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733
Total Post Ratings: +180
|
 |
« Reply #3 on: 02 May, 2012, 22:14:25 » |
0
|
Oh sorry, though Lua  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.
|
|
|
|
|
Logged
|
|
|
|
Deathrider
LV1 Newcomer (Next: 20)
Offline
Last Login: 20 May, 2013, 20:13:33
Date Registered: 02 May, 2012, 12:10:07
Posts: 13
Topic starter
Total Post Ratings: 0
|
 |
« Reply #4 on: 03 May, 2012, 12:02:52 » |
0
|
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.
|
|
|
|
|
Logged
|
|
|
|
northern_snow
LV4 Regular (Next: 200)
  
Offline
Gender: 
Last Login: 18 May, 2013, 15:23:02
Date Registered: 30 July, 2010, 07:34:33
Posts: 104
Total Post Ratings: +12
|
 |
« Reply #5 on: 11 May, 2012, 15:14:34 » |
0
|
I think you should make sure that the voltage of the batteries in two calculators are the same. That may influence the result.
|
|
|
|
|
Logged
|
|
|
|
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
Online
Gender: 
Last Login: Today at 04:59:25
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50212
Total Post Ratings: +2613
|
 |
« Reply #6 on: 11 May, 2012, 15:44:42 » |
0
|
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.
|
|
|
|
|
Logged
|
|
|
|
|