zengm-games / zengm

Basketball GM (and other ZenGM games) are single-player sports management simulation games, made entirely in client-side JavaScript.
https://zengm.com
Other
373 stars 134 forks source link

Preseason waiting times? #467

Open mamamia5x opened 6 months ago

mamamia5x commented 6 months ago

In all sports of Zen GM, I'm getting really long waiting times when it comes to going from preseason to regular season. Sometimes it can take upwards of 5 minutes just to load into it, or I've been stuck for over 10 minutes and have just given up. I don't know what's causing it, the console doesn't show anything. I just thought I'd let it be known, since it's kind of a big issue if it's happening to others

dumbmatter commented 6 months ago

Is this only in leagues with many seasons, or is it even in a new league?

And what OS, browser, and browser version is this?

It's probably related to deleting old box scores, since not much else happens at that time. But that shouldn't take 10 minutes. In the past there were performance issues with that in Firefox, but that was fixed years ago.

mamamia5x commented 6 months ago

I'm using chrome v 124.0.6367.91 on Windows 11.

It does happen with bigger league files, and I've been able to recreate it more when I leave the tab as it is processing to do something else. In BaseballGM and HockeyGM, it tends to happen more often and longer, with smaller league files, but I'm assuming that's since they'll have bigger league files. I haven't played football-gm in a bit, and I haven't had it in happen in FBGm

dumbmatter commented 6 months ago

In my testing, it is indeed deleting the box scores that takes most of the time. Which is probably why it doesn't happen in FBGM - fewer games.

However for me (also in Chrome 124) it only takes about a second. And that doesn't change even if I put the tab in the background.

So let's get more specific and see if we can figure out what exactly is going on for you.

How long does it take in a new league (BBGM, random players)? And what about in the 2nd season? 3rd season? Or more?

If deleting box scores is the problem, you should see it be very fast for the first 3 seasons, and then get much slower in the 4th season. And then performance should remain about the same indefinitely, since it's deleting about the same number of box scores each season.

Also hardware could play a role. Do you have an SSD or not? SSD could make it faster, and I have one. And if you look up your CPU at https://www.cpubenchmark.net/cpu_list.php what is the CPU Mark score? Mine is 13208.

There are a couple things I could do to speed up deleting of box scores: