Page 1 of 1

mod performance

Posted: 16 Aug 2010, 00:41
by dcore221
which uses least system resources or gives best performance?

animation
lua vs cob

modals
3do vs s3o

unit attributes
fbi/tdf vs lua

any others you would add?

Re: mod performance

Posted: 16 Aug 2010, 06:14
by Pressure Line
I think Lua is marginally slower than bos/cob (we are talking about fractions of an fps here, even on a low end machine)

pathfinding is the major bottleneck in Spring, iow if you are wanting to make "omg the mod/game which gets the highest fps consistently" as its major criterion, make something like comshooter, but with no unit animations.

Otherwise, don't worry about it.

Re: mod performance

Posted: 16 Aug 2010, 20:57
by Forboding Angel
Assuming you want to get uber technical.

1. Cob

Many of us still use cob because that's what we like (personally I prefer it, but that's jsut because cob is quite a bit easier to deal with imo).

Then the others are nobrainers :-)

2. s3o

3. Lua

Re: mod performance

Posted: 17 Aug 2010, 05:10
by Das Bruce
(personally I prefer it, but that's jsut because cob is quite a bit easier to deal with imo).
Forb is objectively wrong. :P
If you don't know cob already, learn lua. All the other scripting is done in lua.

Re: mod performance

Posted: 17 Aug 2010, 06:11
by Pressure Line
Notice that he didn't ask for "which would be better for my workflow to learn?" but "which would be better for my fps?"

Re: mod performance

Posted: 17 Aug 2010, 06:53
by Google_Frog
I think Lua is marginally slower than bos/cob (we are talking about fractions of an fps here, even on a low end machine)
If the difference is that small use lua.

The only advantage of cob is by the time you bludgeon it into working the average computer will be faster than if you used lua. Cob is something extra to learn as you will need a lua.

Re: mod performance

Posted: 17 Aug 2010, 07:34
by Pressure Line
Tobi wrote:In other news, I now also tested call-out speed (random series of 1000 moves and turns: 50/50 move/turn, 50/50 now/speed, random destinations, axes and speeds). The results:

Code: Select all

COB: 90000*1k calls in 10147 ms -> 8870000 calls/second
Lua: 40000*1k calls in 11754 ms -> 3403000 calls/second
So unfortunately COB is about 2.6x faster for practically infinitely long move/turn sequences. (On the other hand, Lua is about 4.2x faster for simple call-ins.)
But notice you are talking about the difference between 8870 and 3403 calls per THOUSANDTH of a second in terms of simple animations, other stuff lua does faster.

Realistically, unless you are trying to get this to run on your 166MHz P1, its not an issue.

I believe Lua unit/weapondefs load slightly [and again, we are probably talking milliseconds here] quicker, because they don't have to get parsed into Lua first.

But realistically, if you write slow code, waste polies on models, make your textures bigger than they need to be and use too many movetypes your mod will run 'slow' no matter what file format or language you use.

Re: mod performance

Posted: 17 Aug 2010, 11:25
by AF
Also keep in mind if you go with cob you forfeit some pretty standard things, e.g. cob has no strings. What's more for anything beyond simple movements, aka things that need coordination with lua gadgets, you need cob<->lua calls, which are horrendously slow in comparison.

Use lua, only use cob to maintain existing scripts

Re: mod performance

Posted: 17 Aug 2010, 19:45
by dcore221
didt realize theirs a war going on :]

thanks for replys very informative
il stick with cob for now
is there any chance that lua will get faster as techniques improve?

Re: mod performance

Posted: 17 Aug 2010, 20:12
by FLOZi
The difference isn't even measured its purely guesswork afaik. If you don't already have dozens of cobs laying around, use lua.

Re: mod performance

Posted: 18 Aug 2010, 05:00
by lurker
Lua itself is MUCH faster, it just has a disadvantage on certain calls.

Re: mod performance

Posted: 18 Aug 2010, 06:09
by bobthedinosaur
This is just idiotic. There is no lua is always faster than cob or vice versa. Because you can code things differently to do the same thing and what is the most important is efficiency, whether it is lua or cob. Granted there are some speed differences with how spring handles lua vs tdf or cob, yet the real issue is how clean and simple of a script to do the same job.

Re: mod performance

Posted: 19 Aug 2010, 09:34
by Google_Frog
dcore221 wrote:is there any chance that lua will get faster as techniques improve?
If this is the only reason for your choice use lua. It is much more flexible and there is no significant speed difference, the people here are just splitting hairs over speed.