2025-07-20 01:10 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0004316Spring engineGeneralpublic2014-02-28 08:41
Reportersilentwings 
Assigned TojK 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version96.0.1+git 
Target VersionFixed in Version 
Summary0004316: perf drop between 96.0 and 96.0.1-260
DescriptionSee videos - they are of a stress test I use (which was designed as a way to look for bugs in unit/lua scripts).

Both videos are the current BA svn, with an extra gadget that runs the stress test. It places many units and gives them move/fight/patrol orders, causing a huge battle and a deliberately high lua load. One video is 96.0 and the other is 96.0.1-260.

In 96.0 the test runs smoothly, fps consistently high, game speed 1.0. In 96.0.1-260, there are constant 0.5-1 sec jitters, game speed varies wildly between 0.5 and 0.8, fps also varies wildly between 1 and 60. My video capture is far from perfect, but it is easily enough to see the difference.

In both videos I turned on /debug mode after about 30 secs.
Additional InformationI can provide a .sdz that runs the test, if needed.

96.0: http://www65.zippyshare.com/v/57540715/file.html
96.0.1-260: http://zippyshare.com/
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0012855

silentwings (reporter)

Last edited: 2014-02-22 02:27

View 3 revisions

-260 is the latest version I can test with, because of http://springrts.com/mantis/view.php?id=4315.

for some reason the 96.0.1-260 link didn't come out above: http://www55.zippyshare.com/v/4420545/file.html

~0012859

silentwings (reporter)

Last edited: 2014-02-22 13:31

View 2 revisions

I've bisected this and it seems there is a very noticeable drop in performance between 96.0.1-147-ge82a681 (which runs as well as 96.0 in the video) and 96.0.1-159-g7f66476 (which is as bad as -260). There are no windows builds in between these.

a few commits possible, but the big ones here are sdl1 -> sdl2 and utf8.

~0012867

jK (developer)

When you compare your /debug output you see that -260 spend upto 84% in EventHandler::GameFrame -> that's Lua's GameFrame event

~0012868

silentwings (reporter)

Last edited: 2014-02-22 19:21

View 2 revisions

Yes - the lua being run in each case is identical, and deliberately puts alot of stress on the engine, in gadget:GameFrame.

So as far as I can see (some aspect of) lua suffered a huge performance drop between -147 and -159 ?

Let me know if you want any more info/tests.

~0012869

jK (developer)

I am pretty it doesn't run the same lua code

~0012870

silentwings (reporter)

Last edited: 2014-02-22 19:30

View 2 revisions

Well - from the point of view of mod it is identical, although there is some random numbers generated. The .sdd used in each case is identical. I can give you a sdz of it if it would help.

~0012871

jK (developer)

Last edited: 2014-02-22 19:33

View 2 revisions

scan the gadgets for `gadget:GameFrame` in _unsynced_ side, those weren't executed before 96+ (only when you used them in/for SendToUnsynced)

~0012872

silentwings (reporter)

Last edited: 2014-02-22 20:08

View 3 revisions

I have checked every isntance of GameFrame in BAs gadget code and they are all within synced.

Within the two tests, the only gadget code that is putting stress on the engine is the GameFrame call from the stress testing gadget; all others are negligable by comparison. This can be checked in both cases using the gadget profiler.

~0012877

jK (developer)

then your code behaves differently between builds

~0012878

silentwings (reporter)

Last edited: 2014-02-23 10:13

View 6 revisions

Yes - that's the problem, that's why I made a bug report. Why should the same .sdd, producing identical looking battles, run far slower with -159 and all later versions than with -147? Isn't that the definition of performance drop??!

[The test is not doing anything unreasonable; it just regulates unit density across the map. It is deliberately written so as it puts a high lua load onto the engine, during a reasonable approximation to a big battle. On each frame it picks a 1x1 square of the map, finds out how many units of each team that section contains, if there are more than wanted it removes some, if less than wanted then it creates some. Every so often it picks a random unit and gives it a new order. ]

~0012879

abma (administrator)

@silentwings:

can you please provide the .sdz, else we can look into our crystal ball and guess possible problems.

~0012880

silentwings (reporter)

Last edited: 2014-02-23 15:51

View 3 revisions

Here: http://www11.zippyshare.com/v/90226553/file.html

The gadget called spam_ emulates the test. You might want to to comment out line 402, which keeps moving the camera around.

+Notes

-Issue History
Date Modified Username Field Change
2014-02-22 01:09 silentwings New Issue
2014-02-22 01:09 silentwings Note Added: 0012855
2014-02-22 01:10 silentwings Note Edited: 0012855 View Revisions
2014-02-22 02:27 silentwings Note Edited: 0012855 View Revisions
2014-02-22 11:06 silentwings Note Added: 0012859
2014-02-22 13:31 silentwings Note Edited: 0012859 View Revisions
2014-02-22 18:03 abma Description Updated View Revisions
2014-02-22 19:07 jK Note Added: 0012867
2014-02-22 19:21 silentwings Note Added: 0012868
2014-02-22 19:21 silentwings Note Edited: 0012868 View Revisions
2014-02-22 19:27 jK Note Added: 0012869
2014-02-22 19:28 silentwings Note Added: 0012870
2014-02-22 19:30 silentwings Note Edited: 0012870 View Revisions
2014-02-22 19:32 jK Note Added: 0012871
2014-02-22 19:33 jK Note Edited: 0012871 View Revisions
2014-02-22 20:02 silentwings Note Added: 0012872
2014-02-22 20:03 silentwings Note Edited: 0012872 View Revisions
2014-02-22 20:08 silentwings Note Edited: 0012872 View Revisions
2014-02-23 02:42 jK Note Added: 0012877
2014-02-23 09:45 silentwings Note Added: 0012878
2014-02-23 09:47 silentwings Note Edited: 0012878 View Revisions
2014-02-23 09:59 silentwings Note Edited: 0012878 View Revisions
2014-02-23 10:10 silentwings Note Edited: 0012878 View Revisions
2014-02-23 10:11 silentwings Note Edited: 0012878 View Revisions
2014-02-23 10:13 silentwings Note Edited: 0012878 View Revisions
2014-02-23 15:08 abma Note Added: 0012879
2014-02-23 15:47 silentwings Note Added: 0012880
2014-02-23 15:50 silentwings Note Edited: 0012880 View Revisions
2014-02-23 15:51 silentwings Note Edited: 0012880 View Revisions
2014-02-28 08:41 jK Changeset attached => spring develop 693db616
2014-02-28 08:41 jK Assigned To => jK
2014-02-28 08:41 jK Status new => resolved
2014-02-28 08:41 jK Resolution open => fixed
+Issue History