immortalityidle / immortalityidle.github.io

Immortality Idle Game Repo
32 stars 31 forks source link

Logging refactor #176

Closed LiquidAlmond closed 1 year ago

LiquidAlmond commented 1 year ago

Refactored logging code to allow for easily adding or modifying log topics and put this logging more inline with existing libraries.

The last bit could just be my opinion though.

LiquidAlmond commented 1 year ago

I like these changes generally, but how does the performance compare to the existing code? One of the late-game issues we've seen before was with logs bogging down the game as time accelerated, so I want to make sure that any changes are at least as performant as what we have now.

These changes seem to be significantly faster than the existing logging system, but I will admit I did somewhat limited testing. I exported my main game (almost done with hells) and imported into the game running on this branch. After letting it run for an hour it seemed to be just as quick as when the test started.

I'll try getting some benchmark data for before and after these changes while you're on vacation.

Edit: Using days per real second as a benchmark, this refactor performed just as well as the existing logging, including lagging at approximating the same time. Since both give the same results, I'm not sure the logging system is the source of the lag. I'll continue doing some testing to see if I can narrow down the issue.