Bug #5147

Spawning and deleting units - performance not restored

Added by Rommel almost 6 years ago. Updated about 5 years ago.

Status:Closed Start date:10/13/2009
Priority:Urgent Due date:
Assignee:- % Done:

0%

Category:Performance breakdown
Target version:1.07.71750
Affected ArmA II version:1.06 BETA First affected build:
Reproduced by another DH user:Yes First affected ArmA II version:
I am using some Mods: Single / Multi Player?:
I am using: BIForumURL:
Reproducible for you: NGUrl:
Related to content of DLC: WIKIurl:

Description

Through some interesting research I was doing today on spawning units and their effect of being re-created and deleted dynamically compared to having units being placed in the mission SQM. I noticed a interesting effect!

Units placed in the editor, when deleted, relinquish little resources and their usage on the CPU, whereas spawned units can be created and removed with LITTLE effect on the CPU, both initially and overall.

For example, 10 USMC Squads in the editor, all units deleted spare the group leaders, 10FPS gain (associated to the lack of GPU load).
10 USMC Squads spawned, all units deleted spare the group leaders, 30FPS gain (assuming same as before, that gives 20FPS more associated with the CPU).

mpmissions.zip (5.5 kB) Rommel, 10/14/2009 06:29

performanceLoss_missionUnits.utes.7z (20.6 kB) Rommel, 05/18/2010 19:15


Related issues

related to ARMA2 Community Issue Tracker - Bug #5356: FPS Drop Proportional with No. Entity's Closed 10/23/2009
related to ARMA2 Community Issue Tracker - Bug #10544: Deleted units bring only about 1/3 of FPS back Closed 05/08/2010

History

Updated by Rommel almost 6 years ago

Would just like to also inform, I have spawned and deleted up to 15,000 units now, remaining at 60FPS.

Updated by Fireball almost 6 years ago

  • Status changed from New to Feedback
  • Graphics card changed from ATI 48901G to ATI 48901G

Rommel wrote:

Would just like to also inform, I have spawned and deleted up to 15,000 units now, remaining at 60FPS.

Does that mean we have a problem now or not? What's the conclusion??

Updated by Dwarden almost 6 years ago

  • Assignee set to Dwarden

Updated by Dwarden almost 6 years ago

got sample missions ?

as i assume You used createGroup and deleteVehicle but always better to have original missions to be sure

Updated by Dwarden almost 6 years ago

  • Priority changed from Normal to Urgent
  • Target version set to 1.05 BETA

Updated by Dwarden almost 6 years ago

another important thing was it tested also on dedicated server or just local server? also SP or MP editing ?
also what's important are what squads and what units etc. repro sample missions again ...

Updated by Rommel almost 6 years ago

Was tested by myself, on my own hosted server (ie local MP editor). These demomissions provide an approximate 5-10 FPS difference between mission.sqm AI and spawned AI (was unable to produce as drastic results as before?).
However both show signs that after removing all the AI, FPS does not return to what it was prior (36FPS average compared to 60FPS average, despite NO UNITS and NO GROUPS (cleaned up.)).

Hope this helps and better explains the issue.
cheers,

Romm

Updated by Rommel almost 6 years ago

Files didn't attach properly.

Updated by Fireball almost 6 years ago

  • Due date set to 11/13/2009

Updated by Fireball almost 6 years ago

  • Status changed from Feedback to Assigned

Updated by Rommel almost 6 years ago

Units: 41
Groups: 34
Vehicles: 282

FPS: 49


Units: 52 (27% increase)
Groups: 45 (32% increase)
Vehicles: 290 (2.8% increase)

FPS: 29 (69% decrease)

------
Units: 108 (107% increase - from above)
Groups: 45
Vehicles: 290

FPS: 29 (No change - from above)

Its not model related lag, the number of groups clearly determines the lag experienced!

Updated by Fireball almost 6 years ago

Wrong bug? Did you mean #5356?

Updated by Rommel almost 6 years ago

I wouldn't say they are unrelated.

Updated by kju almost 6 years ago

  • Target version changed from 1.05 BETA to Upcoming version

Updated by kju over 5 years ago

  • Due date changed from 11/13/2009 to 01/02/2010

Updated by kju over 5 years ago

  • Due date changed from 01/02/2010 to 03/03/2010
  • Category changed from AI Issues to Performance breakdown

Updated by Rommel over 5 years ago

This still occurs. 50 groups with 1 man cause as much lag as 200 units in 50 groups. It is wrong, and very frustrating.

Updated by Rommel over 5 years ago

It also doesn't make sense that a player should experience lag from these groups, ie the AI for the groups is on the dedicated server, but a player receives as much FPS drop unless he rejoins (therefore does not 'load with' the AI.

What I'm saying is, a JIP will get more FPS than someone who was there from the start, even if all AI groups are deleted, the non-JIP will still lag.

Updated by kju over 5 years ago

  • Affected ArmA II version changed from 1.04.59026 to 1.05.62017

Updated by Rommel over 5 years ago

VERSION 1.05 (non-beta)
Reproduction mission. 'Radio - Bravo' (shows map info). 'Radio - Alpha' (deletes all units and vehicles except player). Then 'Radio - Bravo' again (map is empty).
You should notice a huge loss of FPS despite there being nothing left on the map, ie somewhere there is a leak!

VERSION 1.05 (beta)
Tested with build 70256, no difference.

Updated by kju over 5 years ago

  • Due date changed from 03/03/2010 to 06/18/2010
  • Affected ArmA II version changed from 1.05.62017 to 1.06 BETA

Updated by Rommel over 5 years ago

Ok some data for you devs. These tests were repeated three times with same result.

5*15 = 60 units.
After deletion, 60fps.

10*15 = 120 units.
After deletion, 60fps.

15*15 = 180 units.
After deletion, 60fps.

20*15 = 240 units.
After deletion, 60fps.

25*15 = 300 units.
After deletion, 45fps.

30*15 = 360 units.
After deletion, 30fps.

35*15 = 420 units.
After deletion, 28fps.

This ... is stupid :P

Updated by Suma over 5 years ago

  • Subject changed from Mission.sqm Memory Leak to Spawning and deleting units - performance not restored

Updated by Suma over 5 years ago

  • Status changed from Assigned to Resolved
  • Target version changed from Upcoming version to Warfare BE 2.061

I have debugged the issue. Here is what I have found: after unit was deleted, some slots were still reserved for future units in the visibility matrix. If you would spawn a new unit, those resource would be used, therefore it is not a true leak. Moreover, it has no relation to memory at all. Therefore I have changed the issue title.

That said, I have changed the visibility matrix logic so that such reserved slots are cleaned more often, and even if they exists, they now use a lot less CPU time.

At the same time, the visibility matrix traversal was optimized in some particular situations, where there are lots of units, but one a few visibility tests are really performed. This could somewhat help performance is some other situations with many units or vehicles. Note: I have not performed any measurements of such situations, but I would not expect anything significant here, only a minor performance improvement.

Updated by kju over 5 years ago

  • Assignee changed from Dwarden to Rommel
  • Target version changed from Warfare BE 2.061 to 1.06 BETA

Thanks a lot Suma!

Updated by Rommel over 5 years ago

Thanks Suma! Can't wait to test it, will do the same caliber of testing when possible.

regards,

Updated by Rommel over 5 years ago

AFAIK, it is 100% fixed, however I am yet to test it for persistence over a longer duration, and server side consistency of the fix. Either way, fantastic job!

Updated by kju about 5 years ago

  • Status changed from Resolved to Closed
  • Assignee deleted (Rommel)

Updated by kju about 5 years ago

  • Due date deleted (06/18/2010)

Updated by kju about 5 years ago

  • Target version changed from 1.06 BETA to 1.07.71750
  • Audio card set to Please specify!

Also available in: Atom PDF