Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: Performance Issue - CPU Bottleneck ?  (Read 3148 times)

Plasmodium

  • Ensign
  • *
  • Posts: 9
    • View Profile
Performance Issue - CPU Bottleneck ?
« on: June 09, 2020, 01:28:58 PM »

Hey guys !

After playing with mods for a bit, I noticed I had significant performance issues during combat, especially during big battles. I've used The Last Hurrah as a baseline for my tests. With mods, I often had around 30-40 FPS during this mission with 0% idle, even without much stuff going on on the screen.

I've tried disabling all the mods and then playing on a clean install, no mods. I gained a few FPS (it sits at ~40-60 for most of the fight) but it's still very low compared to what I am expecting (targeting 144 FPS).

After a bit of digging and CPU/GPU usage monitoring with MSI Afterburner, I found out that my GPU sits at ~20% usage at most and 3 of my CPU cores are often at nearly 100% load, which seems weird to me since Starsector is supposed to mostly use a single core. RAM usage seems to be fine.

FIY, on the campaign map with Nex + 5 faction mods + adjusted sector (x1.1 sector size) and a bunch of other mods, I hover around 100-120 FPS with 0% idle, which is more understandable as a lot of stuff is going on. Without any mods, I get a stable 144 FPS with 30-50% idle.



These are my specs:
- i5-2500k OC'd to 4.3 GHz
- MSI 970 GTX OC'd (4 GB VRAM, 1113 MHz core clock, 3953 MHz memory clock)
- 16 GB RAM
- Windows 10 64 bits

My settings:
- vmparams RAM set to 8192.
- vsync off
- fps 144
- fullscreen

The steps I've taken to solve the problem:
- Making sure the GPU was handling the game through the Nvidia control panel
- Disabling Vsync, setting the openGL stuff on the 970 GTX in the control panel
- Updating the drivers
- Reinstalling the game

I haven't found any solution so far as most performance issues with decent rigs seem to be linked to AMD GPUs, which isn't my case.
Any help would be greatly appreciated, let me know if I can provide more information, or if I can get more precise tools to monitor how the game uses resources.
Thanks a lot !
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Performance Issue - CPU Bottleneck ?
« Reply #1 on: June 09, 2020, 01:49:50 PM »

Hmm - that is pretty strange; the frame rate you're getting in Last Hurrah almost sounds like what you'd get if the game was indeed not running on the right GPU. In the Nvidia control panel, the executable you need to associate with the GPU is java.exe, the one found in C:\Program Files (x86)\Fractal Softworks\Starsector\jre\bin

... I found out that my GPU sits at ~20% usage at most and 3 of my CPU cores are often at nearly 100% load, which seems weird to me since Starsector is supposed to mostly use a single core.

Yeah, that seems... well, I'd say just about impossible for the game to do - max out 3 CPU cores, that is. Most of it is on one core; music playback is on another and that'd have a tough time maxing it out. So this likely means something else is eating up system resources? I'd look at whatever else you might have running.

Of note: MSI Afterburner is known to cause problems (iirc of the "game doesn't start" variety), but it might not hurt to try running the game with it turned off, anyway.

(I'd still say that if you're hoping for a smooth 144 fps in battle, it's not likely to happen, but, yeah, the performance you're getting does seem lower than expected.)
Logged

Plasmodium

  • Ensign
  • *
  • Posts: 9
    • View Profile
Re: Performance Issue - CPU Bottleneck ?
« Reply #2 on: June 09, 2020, 02:46:18 PM »

Hmm - that is pretty strange; the frame rate you're getting in Last Hurrah almost sounds like what you'd get if the game was indeed not running on the right GPU. In the Nvidia control panel, the executable you need to associate with the GPU is java.exe, the one found in C:\Program Files (x86)\Fractal Softworks\Starsector\jre\bin

Yes, that is what I did as I saw it mentioned in several other threads. Since the GPU gets to 20% load while in game, I don't think it is the root of the problem. Also it's the only GPU on my computer so I don't think the game could not use it.

Otherwise I don't have much else running that is resource hungry aside from Chrome, but I'll try monitoring more precisely. Do you know of any way to monitor the resource usage of the game only ? I'm not an expert at all on this subject  :D

I'll try running the game without MSI Afterburner, we'll see what happens.

Sure, I'm not hoping for 144 FPS in big battles, but 40-60 seems a bit low for my specs indeed.

Anyway, thanks for your quick answer !
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Performance Issue - CPU Bottleneck ?
« Reply #3 on: June 09, 2020, 03:16:26 PM »

Do you have an anti-virus running, perhaps? If so, temporarily turning that off seems worth a shot. I'd also suggest turning off Chrome; it's a long shot but depending on what's open in it, who knows.

Otherwise I don't have much else running that is resource hungry aside from Chrome, but I'll try monitoring more precisely. Do you know of any way to monitor the resource usage of the game only ? I'm not an expert at all on this subject  :D

I'm not either, particularly :) What does task manager show?
Logged

Plasmodium

  • Ensign
  • *
  • Posts: 9
    • View Profile
Re: Performance Issue - CPU Bottleneck ?
« Reply #4 on: June 09, 2020, 04:50:25 PM »

Ok so I closed Chrome and MSI Afterburner and saw a huge increase in performance (160 FPS, 50% idle at the start of the battle, then averaging 90-100 FPS during the more intense fights, which seems more reasonable). I reopened both to make sure they caused the issue, relaunched the game and I got the same performances. So I still have no idea where it comes from  :D

Though CPU usage has improved, it still seems a bit high to me (1 core with 100% load, other cores with moderate-high load). I have two screenshots, one taken during the mission, the second one idle with the game closed to compare CPU/GPU usage.
https://imgur.com/a/USzYRYY

Otherwise I don't have any antivirus running besides Windows Defender. I remember having some trouble with other games that were linked to background services like Win Def running analysis and drawing lots of resources but I highly doubt it's the case here as I've been experiencing this for a few days consistently.

I'll see if I can reproduce this behavior or if it stays this way and I'll try to see how it holds up with mods.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Performance Issue - CPU Bottleneck ?
« Reply #5 on: June 09, 2020, 05:09:56 PM »

Ah, interesting - I wonder if just rebooting would've also done the trick.

Though CPU usage has improved, it still seems a bit high to me (1 core with 100% load, other cores with moderate-high load).

If you've uncapped the framerate using settings.json (which I'm guessing you did, or you wouldn't be getting 160 fps), then it's reasonable that you'd get 100% CPU use on one core, since the game will be trying to push out as many frames as possible. I'm a bit surprised by 160 fps and 50% idle, though, the idle not being zero implies that the fps is in fact capped to 160 somehow - either via vsync or via that being the "fps" value in settings.json...
Logged

Plasmodium

  • Ensign
  • *
  • Posts: 9
    • View Profile
Re: Performance Issue - CPU Bottleneck ?
« Reply #6 on: June 10, 2020, 12:43:16 PM »

Yeah there seems to be some overshoot in terms of FPS, it's often oscillating between 145-160 in menus etc. I've definitely disabled Vsync in both Nvidia control panel and settings.json. I tried again today on vanilla, there seems to be no issue and I get decent performances.

However I tried turning on GraphicsLib and performance tanks A LOT (30-60 FPS in combat). I've tried tweaking graphic settings a little bit (disabling ripples, lighting, bloom, explosions effects...). I also tried turning enableShaders to false to disable the mod effects and reinstalling mods, closing Chrome and MSI Afterburner, to no avail. Any tips on this side?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Performance Issue - CPU Bottleneck ?
« Reply #7 on: June 10, 2020, 04:53:16 PM »

(Let me move this to the modded section.)

As far as GraphicsLib: as far as I know, setting enableShaders to false makes it have zero performance impact, so that's surprising. Perhaps someone with more experience on that side of of things can chime in?
Logged

MesoTroniK

  • Admiral
  • *****
  • Posts: 1731
  • I am going to destroy your ships
    • View Profile
Re: Performance Issue - CPU Bottleneck ?
« Reply #8 on: June 10, 2020, 08:51:05 PM »

What is your modlist?

n1Z0

  • Ensign
  • *
  • Posts: 31
    • View Profile
Re: Performance Issue - CPU Bottleneck ?
« Reply #9 on: June 11, 2020, 02:30:00 AM »

Chrome can chew up a surprising amount of resources... for a browser.
Logged

Plasmodium

  • Ensign
  • *
  • Posts: 9
    • View Profile
Re: Performance Issue - CPU Bottleneck ?
« Reply #10 on: June 11, 2020, 10:58:00 AM »

What is your modlist?

For the tests I've been running with LazyLib and GraphicsLib only. I've tried disabling enableShaders, then keeping it on and having enableLights, enableBloom, enableNormal, useLargeRipple, enableExplosionTrails, enableWeaponSmoke set as false.

The modlist in my current playthrough (I'm getting roughly the same performances in Last Hurrah as with only GraphicsLib) is:
- Lightshow
- Trailer moments
- Adjusted sector (same sector size, just more cryosleepers/motherships)
- Automatic orders
- Autosave
- Better colonies
- Blackrock
- Combat chatter
- Commissioned crews
- Console commands
- DME
- Disassemble reassemble
- HMI
- Imps weapon sounds
- Industrial evolution
- Interesting portraits pack
- Lazylib
- Leading pip
- Legacy of Arkgneisis
- Luddic enhancement
- Magiclib
- Nex
- Ruthless Sector
- Scy nation
- SWP
- Speedup
- Stop gap measures
- Tahlan shipworks
- Terraforming and station construction (gates disabled)
- Tiandong heavy industries
- Underworld
- Unknown skies
- Vayra's ship pack
- Version checker
- Weapons group controls
- Audio plus
- Graphicslib

Overworld map performance is fine with all these mods, but tanks during battles, even medium sized ones. Closing Chrome definitely helps a bit :D
Logged