View Issue Details

IDProjectCategoryLast Update
0024697AI War 2SuggestionFeb 24, 2022 10:52 am
ReporterChris_McElligottPark Assigned ToChris_McElligottPark  
Status resolvedResolutionfixed 
Product Version2.801 Initial Hotfixes 
Summary0024697: For the future: remove short term and long term thread planning data copies.
DescriptionI keep thinking of this, and keep forgetting about it, so I'm writing it down. This is going to cause nontrivial amounts of new and intermittent cross-threading bugs when I do it, so it will have to be on a beta branch. But there's a solid chance that this will up the performance of the simulation pretty dramatically.

Right now, before any "short term planning" happens (aka, the background threads that are part of a sim step every 100ms), a bunch of stuff gets copied to some working variables. When all of them are finished, certain results get copied back. This was done in the name of thread safety, and to try to have deterministic threading (years ago, back before we abandoned that concept). By removing these intermediate variables, I can cut down dramatically on two sim-thread events that I know from past profiling take up quite nontrivial amounts of CPU time.

The long-term-planning stuff is more intermittent, but I think also still problematic. It may not need to be removed, but I need to look at it. It's for the various factions doing their on-host long term planning logic, and I don't remember exactly what is in there, but I don't think its actually needed. A vast majority of what those threads use actually goes AROUND these long-term planning variables, which is why these are not all that noteworthy. In some respects, they may actually be less prone to errors from changing this, since they already at least partially ignore it. Nonetheless, all those extra variable copies back and forth are not something I want to have in there if it might be slowing things down.

Something for post-DLC2, when I can do a beta period for a few weeks at minimum.
TagsNo tags attached.

Activities

BadgerBadger

Feb 22, 2022 8:57 pm

manager   ~0064734

Wasn't this already done?

Chris_McElligottPark

Feb 24, 2022 10:52 am

administrator   ~0064798

Yep!

Issue History

Date Modified Username Field Change
Apr 16, 2021 9:47 am Chris_McElligottPark New Issue
Apr 16, 2021 9:47 am Chris_McElligottPark Status new => assigned
Apr 16, 2021 9:47 am Chris_McElligottPark Assigned To => Chris_McElligottPark
Feb 22, 2022 7:47 pm ZeusAlmighty Relationship added related to 0026495
Feb 22, 2022 7:48 pm ZeusAlmighty Relationship deleted related to 0026495
Feb 22, 2022 8:57 pm BadgerBadger Note Added: 0064734
Feb 24, 2022 10:52 am Chris_McElligottPark Status assigned => resolved
Feb 24, 2022 10:52 am Chris_McElligottPark Resolution open => fixed
Feb 24, 2022 10:52 am Chris_McElligottPark Note Added: 0064798