Omnimaga

Calculator Community => TI Calculators => Lua => Topic started by: Hot_Dog on April 19, 2011, 07:27:16 pm

Title: Relative speed of Lua?
Post by: Hot_Dog on April 19, 2011, 07:27:16 pm
Let's say TI-Nspire speed could be measured on a scale of 1-10, with Ti-Basic code at 1 and ASM/C Code at 10. 

Very, very roughly, where would Lua fall on this scale?



PS: Imo speed doesn't matter.   I know that the importance of LUA is what it can let Ti-Basic users do.  I'm just curious ;D
Title: Re: Relative speed of Lua?
Post by: Deep Toaster on April 19, 2011, 07:29:27 pm
No idea, but Nspire BASIC is already pretty fast :hyper:
Title: Re: Relative speed of Lua?
Post by: Ashbad on April 19, 2011, 07:59:58 pm
I cannot make that comparison for NSpire Lua -- but if TI basic for computer (:P) was 1 and x86 assembly as a 10, computer Lua is a bit closer to a 5.  Python is a 7.  Java is 8, C is 9, for more comparison ;)
Title: Re: Relative speed of Lua?
Post by: DJ Omnimaga on April 19, 2011, 08:26:03 pm
It's hard to tell. If they use the same code for both interpreters, maybe the speed is the same. That said, Lua offers a bit more freedom even if it's a stripped version of it.
Title: Re: Relative speed of Lua?
Post by: Levak on April 19, 2011, 08:33:06 pm
Exactly : 8
I can make a 30fps program displaying 3D models in a complete animation.
This test has been performed by calculating how fast my program can display a model during a rotatation of 2*pi with a pi/100 increment and a refresh rate of 100fps (100fps => 30fps, 10fps => 7fps).

It is really good, to my mind, comparing to the TI-Basic that need over than 2 secondes to display the same model only one time.
Title: Re: Relative speed of Lua?
Post by: willrandship on April 19, 2011, 08:34:57 pm
Wow! is that your port of Make3D getting 30 FPS? That's probably looking pretty fuzzy on the screen (darn crappy lcds :P), and that is really, really fast!
Title: Re: Relative speed of Lua?
Post by: Hot_Dog on April 19, 2011, 08:39:35 pm
Exactly : 8

0_0
Title: Re: Relative speed of Lua?
Post by: Deep Toaster on April 19, 2011, 08:48:53 pm
That is fast ... like Axe fast (compared to other Z80 calc stuff, of course).

Guess I'm gonna learn Lua after all :D
Title: Re: Relative speed of Lua?
Post by: willrandship on April 19, 2011, 08:50:13 pm
Well, the Calc is at least 15 times more powerful. ARM vs z80, ARM wins. even if the z80s were 150 mhz, they would still lose.
Title: Re: Relative speed of Lua?
Post by: Hot_Dog on April 19, 2011, 08:51:27 pm
Well, the Calc is at least 15 times more powerful. ARM vs z80, ARM wins. even if the z80s were 150 mhz, they would still lose.

Partly, but not fully, because it has automatic multiplication (in z80, we have to do multiplication ourselves!)
Title: Re: Relative speed of Lua?
Post by: Levak on April 19, 2011, 08:58:37 pm
Wow! is that your port of Make3D getting 30 FPS? That's probably looking pretty fuzzy on the screen (darn crappy lcds :P), and that is really, really fast!
Yes !
Have a look :
http://education.ti.com/html/nspireplayer/3.0.1/application/index.html?locale=en&nspirefile=http://levak.free.fr/ftp/nspire/Make3D/Make3D.tns
(I have to keep a GUI for nspire-player whereas there are many shortcuts activated to modify some globals)
Title: Re: Relative speed of Lua?
Post by: ralphdspam on April 19, 2011, 09:19:10 pm
Nice! :w00t:  Great demo!  It's so fast!
Title: Re: Relative speed of Lua?
Post by: Deep Toaster on April 19, 2011, 10:04:47 pm
It is, wow O.O
Title: Re: Relative speed of Lua?
Post by: ruler501 on April 19, 2011, 10:07:08 pm
Wow this is great. I'm going to love to see how my game does. I hope I don't over do it
Title: Re: Relative speed of Lua?
Post by: willrandship on April 19, 2011, 10:11:40 pm
@Hot Dog how is automatic multiplication a bad thing? Hardware multiplication would be faster, not slower, than software based methods.

Also, I hate TI hating linux. :( Not supported :P
Title: Re: Relative speed of Lua?
Post by: ingalls on April 23, 2011, 09:18:53 am
Also, I hate TI hating linux. :( Not supported :P

I know what you mean! I run linux on all of my computers except for one that runs windows. The only thing I use windows for is nspireLink, notepad for lua and LUAtoTNS.... I sometimes wish I had a mac that I could dual boot linux OSX
Title: Re: Relative speed of Lua?
Post by: jnesselr on April 23, 2011, 12:06:01 pm
Also, I hate TI hating linux. :( Not supported :P

I know what you mean! I run linux on all of my computers except for one that runs windows. The only thing I use windows for is nspireLink, notepad for lua and LUAtoTNS.... I sometimes wish I had a mac that I could dual boot linux OSX
I do! And windows as well!  Which is very fun, b/c the most I've ever run is one virtualized windows, one virtualized linux, mac native, netbeans and safari.  I love spaces too...
Title: Re: Relative speed of Lua?
Post by: GB on April 23, 2011, 12:43:44 pm
I don't care too much for Mac computers. They're just too overpriced for what they are. Running a Hackintosh is better.
Title: Re: Relative speed of Lua?
Post by: ingalls on April 23, 2011, 01:44:56 pm
Yes a good hackintosh is really nice. For awhile I  wanted one just for the multitouch trackpad, it's one of the best on the market but since apple released the standalone desktop trackpad, the linux community has created drivers for it so I should really just buy one for my linux box...
Title: Re: Relative speed of Lua?
Post by: jnesselr on April 23, 2011, 02:02:59 pm
True, they are very expensive.  Although they are generally nice computers as well.
Title: Re: Relative speed of Lua?
Post by: willrandship on April 23, 2011, 03:13:56 pm
But I can make nicer ones for less by hand :P and I can't think of a mac benefit that doesn't happen through linux, for myself anyhow. (except TI link support :P)
Title: Re: Relative speed of Lua?
Post by: z80man on April 23, 2011, 06:04:30 pm
Well, the Calc is at least 15 times more powerful. ARM vs z80, ARM wins. even if the z80s were 150 mhz, they would still lose.

Partly, but not fully, because it has automatic multiplication (in z80, we have to do multiplication ourselves!)
In how many cycles can the ARM do multiplication? As an example the SH4A can do 32 *32 = 64, 32 * 32 = 32, @32 * @32 = 32 in 2 cycles. And it does 16 * 16 = 32 in 1 cycle. This is of course only when it is written properly. Otherwise it is 5 cycles and 3 cycles respectively.

And for the linux thing. Is it possible to use wine for the nspire link support and LUAtoTNS.
Title: Re: Relative speed of Lua?
Post by: ingalls on April 23, 2011, 06:12:56 pm
If you go on over to hackspire there is a lua2tns program, I don't know if it is the exact same one as you are thinking but in short yes there is an easy way to get lua to tns on linux. I haven't tried tilink on wine but from past experience wine programs can't usually connect to external devices (At least with all of the programs I've ever tried) It's always worth a shot though! Give me a shout if you get it working!

Title: Re: Relative speed of Lua?
Post by: calc84maniac on April 23, 2011, 07:15:29 pm
Well, the Calc is at least 15 times more powerful. ARM vs z80, ARM wins. even if the z80s were 150 mhz, they would still lose.

Partly, but not fully, because it has automatic multiplication (in z80, we have to do multiplication ourselves!)
In how many cycles can the ARM do multiplication? As an example the SH4A can do 32 *32 = 64, 32 * 32 = 32, @32 * @32 = 32 in 2 cycles. And it does 16 * 16 = 32 in 1 cycle. This is of course only when it is written properly. Otherwise it is 5 cycles and 3 cycles respectively.
The ARM9EJ-S processor does the following multiplications (with optional accumulate operand):
32-bit = 16-bit*16-bit (signed only, 1-2 cycles)
32-bit = (32-bit*16-bit)>>16 (signed only, 1-2 cycles)
32-bit = 32-bit*32-bit (2-3 cycles)
64-bit = 32-bit*32-bit (signed or unsigned, 3-4 cycles)
64-bit += 16-bit*16-bit (signed only, 2-3 cycles)


Also, these instructions use the general-purpose registers as destinations.
Title: Re: Relative speed of Lua?
Post by: willrandship on April 23, 2011, 07:29:53 pm
@z80man, no, WINE can't do hardware. There is TilP tho, and there's a Linux version of Lua2TI.

Unfortunately, OS 3.0 can't send with TilP. Can't test for the docs.
Title: Re: Relative speed of Lua?
Post by: Hot_Dog on April 23, 2011, 07:31:27 pm
@Hot Dog how is automatic multiplication a bad thing? Hardware multiplication would be faster, not slower, than software based methods.


I actually said automatic multiplication was a good thing.  I was insulting the z80
Title: Re: Relative speed of Lua?
Post by: Lionel Debroux on April 24, 2011, 01:14:25 am
For now, I didn't spend time debugging and fixing TILP for sending OS 3.0 - but as we watch the stories of huge problems with OS 3.0 unfold, I don't think that it's much of a problem that TILP will refuse to send that crap :)


Coming back to the earlier posts of the topic: Python is actually not too fast ;)
The VM is fairly heavyweight, and (due to a combination of the VM's performance, and the way user code is written) performance of a number of Python programs, e.g. various Linux distro package managers, is known to be lackluster. I remember about some operations of one of the package managers being more than an order of magnitude faster in C++ than in Python...