Very Newbie question about INLINE

Previous topic - Next topic

mentalthink

HI in my future projects I like put INLINE commands... I think after all this time I not use, and yet it´s the time  :-[

Only a question, I think it´s truly but only for sure...

Making mathematics calculus INLINE it´s more faster than GLBasic... or I need to make the code in a real .Cpp Source and after implement in GLBasic, or it´s ecaxtly the same

Thanks in advance...

MrTAToad

Technically it could be faster inline as you wouldn't have to deal with DGNat classes.  However, whether the actual speed increase is noticable is another matter :)

mentalthink


TI-994A

Quote from: MrTAToad on 2012-Mar-19
Technically it could be faster inline as you wouldn't have to deal with DGNat classes.  However, whether the actual speed increase is noticable is another matter :)
Hello again, MrTAToad.

Correct me if I'm wrong, but since GLBasic isn't an interpretive compiler, shouldn't it not make any difference? Classes or not, at most shouldn't it only affect the conversion process prior to compiling? After all, it does compile to standalone machine code executables, doesn't it?
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!

Kitty Hello

Absolutely. If you want more speed, get a better processor ;)
GLBasic is all compiled. You "might" be faster with using static arrays over the dynamic GLBasic ones. But in real life situations it won't affect the overall speed significantly. It introduces new, hard to find problems, though.

TI-994A

Quote from: Kitty Hello on 2012-Mar-20
Absolutely. If you want more speed, get a better processor ;)
GLBasic is all compiled. You "might" be faster with using static arrays over the dynamic GLBasic ones. But in real life situations it won't affect the overall speed significantly. It introduces new, hard to find problems, though.
A confirmation from the CEO! Thank you for that. I must say that the spectrum of your cross-platform support is amazing, and although it's been a year since I purchased GLBasic, I'm pretty sure it's the ultimate tool for my mobile platform needs.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!

hardyx

INLINE is used often for manage complex classes or structures taken from C sources, or calling external functions in libraries. Making simple calculus in C is normally the same speed than GLBasic. If you use integers (%) is faster than floating point variables in all languages. This is important for portable devices.

Kitty Hello

On processors with an fpu, floats are no slower than ints.

mentalthink

Ok, a lot of thanks a lot, I thinked C++ it´s always the most faster languaje...   :x :x

Thanks to all replies

ampos

Quote from: mentalthink on 2012-Mar-20
Ok, a lot of thanks a lot, I thinked C++ it´s always the most faster languaje...   :x :x

Thanks to all replies

No, machine code is (Yoda said)
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

mentalthink

Si ASM es lo más rápido, pero no me quiero imagina programar el iPhone o el Palm Pre en ASM, si el Amstrad ya es bastante follón, hacer que se mueva un caracter no me imagino como se debe hacer en los cacharros estos...


TI-994A

Quote from: mentalthink on 2012-Mar-20
Si ASM es lo más rápido, pero no me quiero imagina programar el iPhone o el Palm Pre en ASM, si el Amstrad ya es bastante follón, hacer que se mueva un caracter no me imagino como se debe hacer en los cacharros estos...
¿Qué diablos? You can still do that, if you had ASM compilers for those phones. But ASM is not machine code.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!

fuzzy70

When did that change?. As far as I recall ASM is basically mnemonics representing the raw hex numbers of the machine code to make it easier for us humans to write. I first programmed machine code in the late 70's by writing programs in asm on paper then manual converting the commands into hex from the cpu code list.

Sure asm provides some extras like labels etc but the end result is to all intents & purposes machine code with a 1 to 1 translation of mnemonic to cpu opcode. The exception to the rule is macros & such but this is not a lesson on asm.

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

bigsofty

GLBasic, ironically, is actually a very nice platform for learning C++, a little basic wrapper can hide all the usual C project stuff allowing the user to concentrate on the inline or linked C. You can even use the GLB command set as a cross platform API from with the C, to a certain extent.
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

fuzzy70

I have always been "On the fence" so to speak regarding C/C++ in that I have never really got around to learning it or had a need for it's power so to speak. I can work out simple parts of code like loops, branches & conditions etc but beyond that I'm lost  :D

It is on my to-do list to learn some more of C/C++ as there are loads of useful code examples on gamedev.net & other sites for things like effects, engines plus lots of other things. I once converted an improved Bresenham's line algorithm from C in Blitz3d once & even though the Blitz code was 6-7x the length of the C equivalent it was still slightly faster than the native Blitz line command which surprised me.

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)