Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lag spikes every few seconds #185

Open
jklw10 opened this issue Mar 11, 2023 · 4 comments
Open

lag spikes every few seconds #185

jklw10 opened this issue Mar 11, 2023 · 4 comments

Comments

@jklw10
Copy link

jklw10 commented Mar 11, 2023

doesn't seem to be a cpu overload since the usage is under 10% for the whole browser. but the console does spout this:
image
every time said lag spike hits.
not sure which is caused by which though.

@jklw10
Copy link
Author

jklw10 commented Mar 11, 2023

image
yep, a major garbage collection looks like the culprit for the lag spike.
memory allocation benchmark seems to point to TrainingFollowers.consequence
i'll take a gander at it if there's anything fishy looking there.
image

@jklw10
Copy link
Author

jklw10 commented Mar 11, 2023

i can't say there's anything that immediately seems slow, but since the the stact trace does point into the task invocation it's possible that it's making an allocation for each lambda based on the builder's data, so maybe consider making a "trainbuilder" function and calling it instead. again, unsure how JS' internals work and if that would even help there.

Restarting the game seems to have fixed the stutter issue, and to be fair i had it on for 2 days before it was an issue.

@slaymaker1907
Copy link
Contributor

@jklw10 if it happens again, maybe try using some of the heap profiling tools. It looks like you use Edge and there is an option to take a snapshot and to do a sampling on allocations for major GC collections. The big culprit for stuff like this in what I assume is a generational collector are objects which live a moderate amount of time since they get cleaned up at more expensive GC stages and it obviously happens pretty frequently compared to stuff that lives for minutes+.

image

@jklw10
Copy link
Author

jklw10 commented Mar 14, 2023

Allocation sampling just instantly crashes everything, also it's brave but both are chromium based and probably have similar tooling.
And I can confirm that after leaving it to run for like 3 days it just crashed :) after 1 day it had some hiccups like this one. thought it was not that specific action that cause those hiccups since even after removing the training it had issues, though I didn't all that carefully what all is loaded at all times so it's possible that even actions that aren't in use cause issues.

I can give the save file of my progress but you'd have to still run it un interrupted for 1-2 days to get the hiccups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants