Jump to content

A27: Very poor performance on weak hardware?


Meister
 Share

Recommended Posts

On 06/02/2025 at 7:11 PM, real_tabasco_sauce said:

I recommend doing combat demo huge without the petra AI. It helps to have that variable out of the picture. Same for profiling.

For having used profiler regularly for the past week, I can see absolutely 0 pattern. It can be ANY of the task that suddenly slow the game unreasonably. When it's no GC, it's state hash check, when it's not state hashcheck it's sim update, when it's not sim update, it's gui sim update. Any of them can decide to take sometimes 100+ms in a single frame. Of course it's probably linked to what's going on in game you are playing but this still hints something that isn't specific to any task in particular.

Link to comment
Share on other sites

From what I can tell, there's a few things:

  • Vulkan rendering makes the game have much higher FPS on average, so the simulation ticks, which happen every 200ms, are much more noticeable. This is especially true on e.g. Combat-Demo-Huge.
  • Full state hash checks happen every 20 simulation turns (so every 4 seconds) and are quite slow. I'm not sure it's a new problem - could be exacerbated by happening every 4 seconds since this commit, but I'm pretty sure that was in A26 as well. I haven't noticed anything obvious when profiling a few things. It's possible it's also the smoother rendering making it more obvious ?
  • Shrinking GCs happen every 500 simulation turns, so about every minute and a half. These can cause a lag spike.
  • Pathfinder can still lead to some very slow simulation ticks on occasion.
  • The sim itself might have some rare cases where some turns take extra-long, like when a player is defeated.
  • The GUI is also occasionally slow, notably when selecting a lot of units.
  • Like 3
Link to comment
Share on other sites

2 hours ago, Atrik said:

@wraitii Probably stupid idea/question but why isn't it possible to have a kind of proxy function in the engine to execute some of the gui functions, asynchronously while a fully asynchron gui sim is not developed?

In our case asynchronously, would still be on the same thread. We discussed this with @phosit and @bb_ Node has the same issue. What we actually need to do is run the GUI code in another thread completely. But the main issue with selecting units is that it sends a lot of data. Like basically everything we know about these units.

EDIT: See https://code.wildfiregames.com/D1618

  • Like 1
Link to comment
Share on other sites

1 hour ago, Stan` said:

But the main issue with selecting units is that it sends a lot of data. Like basically everything we know about these units.

EDIT: See https://code.wildfiregames.com/D1618

I might even want to try to do it but : is it possible to make the selection more smooth with async js? Like would it even be possible to load minimal entity datas (maybe even without using getEntityState / using a alternative), THEN load entity datas next frame(s)?
I can think of using mouse over event handler to load tooltip datas, but i guess the performance gain aren't worth pursuing, all the datas would be loaded on later frames?

Link to comment
Share on other sites

4 minutes ago, Atrik said:
1 hour ago, Stan` said:

 

I might even want to try to do it but : is it possible to make the selection more smooth with async js? Like would it even be possible to load minimal entity datas (maybe even without using getEntityState / using a alternative), THEN load entity datas next frame(s)?
I can think of using mouse over event handler to load tooltip datas, but i guess the performance gain aren't worth pursuing, all the datas would be loaded on later frames?

You can try js promises that were added in A27 but as I said it's the same thread so it still gonna wait after everything in the thread is done

You still need to load all the datas for whatever you have selected.

  • Like 1
Link to comment
Share on other sites

11 minutes ago, Stan` said:

You can try js promises that were added in A27 but as I said it's the same thread so it still gonna wait after everything in the thread is done

You still need to load all the datas for whatever you have selected.

Yes I know... But that's why I was kinda asking if there is a way to make sure this will actually have a "smoothing" effect. Even if you call some async js function, will it still run it within the same frame (and therefor being totally useless)? Iirc tested it 2 days ago with a dummy 'lag' function. And calling it, was still blocking the frame until completion even if it was an async function.

Link to comment
Share on other sites

1 hour ago, Atrik said:

Yes I know... But that's why I was kinda asking if there is a way to make sure this will actually have a "smoothing" effect. Even if you call some async js function, will it still run it within the same frame (and therefor being totally useless)? Iirc tested it 2 days ago with a dummy 'lag' function. And calling it, was still blocking the frame until completion even if it was an async function.

Yeah async is not a magical bullet :) It only works if you have threads, if you don't, might as well call it synchronously.

  • Haha 1
Link to comment
Share on other sites

Here is something interesting: on extremely OP hardware, the game interface is able to run without lag. So it is not impossible to run the game smoothly,  you just need to upgrade your hardware. This is the system usage during a huge fight:

image.thumb.png.154cb213e20686cc1972c4b1a2056d20.png

The frame rate was between 50fps-80fps. I am using Vulkan + GPU skinning. The operating system is Windows 11 with Atlas OS playbook. On i7-14700, 19% usage means a whole core has been consumed by 0ad. But the detailed load distribution is yet to be seen. (task manager is rubbish)

The simulation still lags, but GUI level stutters didn't exist. When other players with weaker hardware are lagging, I just see the units standing stationary and repeating the same animation without the game actually progressing. 

Tomorrow I will try to install Linux on the same hardware and see if there is a performance difference.  It is worth mentioning that in general, boosted Arch kernels allow you to achieve higher average frame rates than any Windows based OS. 

Edited by Seleucids
Link to comment
Share on other sites

2 hours ago, Seleucids said:

I increased both fps throttling to the maximum:

image.thumb.png.01b8102a064af36861feed7263b0cc96.png

Then it sort of makes sense. The GUI is probably completely GPU bound, which means the game has nothing to do except requesting more frames. In the game though, You're probably being CPU bound, so the game is waiting for the data to send to your GPU.

Note that if you are using VSYNC it will cap the fps at your monitor's refresh rate.

Link to comment
Share on other sites

On 05/02/2025 at 11:21 AM, real_tabasco_sauce said:

Could we schedule a "fast PC" TG for this weekend? I expect that those with really slow computers or adversely affected setups like @Meister are slowing turns for everyone, leading to many reports from players that otherwise have good performance. However, I have never really tried to verify this is the case.

If we get a 4v4 where everyone has ideally >20 fps (min) in combat demo huge (found in scenarios -> demo maps -> combat demo (huge)), we can make sure that this is really the cause.

I'd like to do it on Sunday, maybe when we did the a27 RC test, 18:00 UTC.

@MetaPhyZic @BreakfastBurrito_007 @Ginnungagap, and any others that have good performance in a27.

Well, I suppose with the issue identified (maybe just one of the issues), we probably don't need to do this today. Its telling enough that it takes place, albeit to a lesser extent, even in the first minutes of some games when CPU load from simulation should be really low.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...