Performance track

Performance track

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Performance track

Post by PauloMorfeo »

Hi, following the thread:
http://springrts.com/phpbb/viewtopic.php?f=1&t=30372
I did some performance tracking on Spring.
I replayed a DeltaSiegeDry 8v8 that I had watched on Friday (absolutely Epic, by the way).

At 3 times, I Paused the replay and took notes of FPS.
I took note of FPS while completely zomed out, and completely zoomed in in the middle of the map showing zero units. Also, with luaui disable'd and luaui reload'ed.

0:00 (immediatly after game start, which was the first opportunity to pause)
ZoomOut / Lua -> 80
ZoomOut / NoLua -> 230
ZoomIn / Lua -> 90
ZoomIn / NoLua -> 180

1:31 (quite some units)
ZoomOut / Lua -> 75
ZoomOut / NoLua -> 175
ZoomIn / Lua -> 95
ZoomIn / NoLua -> 180

9:00 (plenty of units)
ZoomOut / Lua -> 50 (50 paused, ~20 with the game running)
ZoomOut / NoLua -> 83
ZoomIn / Lua -> 70
ZoomIn / NoLua -> 145

F11, widget exclusions
At 9:00, I kept the game paused and zoomed out, loaded luaui, and pressed F11. Then I tried removing/adding again most of the widgets. These are the FPS differences I could perceive upon disabling widgets.
Adv Play List: 53->61
Build Bar: +2(???)
Building Hotkeys: -2 (as in actually slower with it disabled, although 2 is unreliable)
Context Building: +4(?)
Custom Icons: +4(?)
Pause Screen: slowdown of some 10 FPS upon activation only
Red Tooltip: -5 (as in slower with it disabled...)

Conclusions
Couldn't track single widget perf differences that ammount for the difference in luaui tracked at 9:00 (from 50 to 83). When I tried removing *all* widgets, perf came back to ~80 which probably means that the luaui being [re]"load"[ed] but not actually running any widgets does not account for much or nothing at all, and that there's probably a substantial slowdown created with some widget interactions (a bitch to track down).

The greatest slowdown may actually be the engine running. I got good FPSs with the game paused but quite far with it running.

Game runs pretty much slower with luaui widgets activated (yeah, I know, pretty hard to guess).

With no luaui, with a lot of units the game slowed down from 230 to 83, while with luaui it only slowed down from 80 to 50.

With plenty of units (9:00), paused, with luaui disabled and not showing any units on the screen (zoomed in), the game still delivered less FPS (145 instead of 180).
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Performance track

Post by knorke »

The greatest slowdown may actually be the engine running. I got good FPSs with the game paused but quite few with it running.
That is normal and unavoidable: The movement of units, physics (all the projectiles etc) need some CPU power. They try to improve it but with complex simulation such as Spring the cost can never be zero..
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: Performance track

Post by Silentwings »

I think you must have a quite low powered system to get those numbers - could you post an infolog? (just out of interest)

As you can see from the results you got, a difference of a few fps is basically sampling error and you need to see a bigger difference (maybe >10 I'd say, hard to quantify) to be certain what you're seeing is caused by disabling the widget and not some non-cosntant bit of your system internals. For example, "building hotkeys" does absolutely nothing after the game start, iirc nor does "custom icons", except at the isntant when it is loaded/unloaded.

A better way to see how much cpu widgets are using is with the widget profiler (which is itself a widget). The amount of widget-widget interaction within BA is small enough that its negliable as far as performance is concerned - the widget profiler tells you pretty much all there is to know. (Result is: widgets with a gui use relatively large amount of res, almost everything else uses ~nothing)
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Re: Performance track

Post by PauloMorfeo »

Think no further - I can confirm it! My laptop was mid/low specs 5 years ago when I bought it.

That widget profiler thing is quite nice and quite enlightening!
Though it needs proper reviewing... Will have to analyse it better. But in even in a 1v1, the AdvPlayersList is the greatest consumer and smashingly in a 8v8 replay.

Sorry, I meant to add more info but I forgot.
(and yeah, I know some of the data is not all that reliable - especially the perception that in a few instances the FPSs increased after enabling 2 of the widgets)

Settings used and InfoLog attached.
SpringLogs.tar.gz
(6.62 KiB) Downloaded 10 times
Last edited by PauloMorfeo on 14 May 2013, 01:25, edited 1 time in total.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Performance track

Post by smoth »

please use pastebin for those logs so the thread isn't blown up.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Performance track

Post by knorke »

If AdvPlayersList lags you too much then disable it.
you can enable the engine's playerlist by typing into chat: /info
(this one does not use any noticable fps for me)

For some widgets their fps cost depends very much on what you are doing. For example widgets that highlight your selected units: with no units selected the cost might be zero but with many selected units might be very high...
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Re: Performance track

Post by PauloMorfeo »

Widget performance profiling widget.

I couldn't figure out what was the relation with the numbers that appear, so I just took note of the parformance counter bars that were standing out (relative to one another). In the replays, I waited to have decent ammounts of units, moved around, selected units and so on.

For what it's worth:

DeltaSiegeDry, replay, 8v8.
AdvPlayersList -> 10
SelectionButtons -> 4
BA_AllyCursors -> 3
IdleBuildersNEW -> 2
BuildBar -> 1,5
EnemySpotter -> 1,5
AllyResourceBars -> 1
Lups -> 1
HealthBars -> 0,5

Small Divide, replay, 1v1
AdvPlayersList -> 10
HealthBars -> 10
BA_AllyCursors -> 2,5
ComCounter -> 2,5
LockCamera -> 2,5

CometCatcher, game vs AI, 1v2
IdleBuildersNEW -> 10
Lups -> 7
BuildBar -> 3
DefensesRange -> 2
Post Reply

Return to “Lua Scripts”