Closed Xemorr closed 2 years ago
I wouldn't say this is any issue, as the plugin does not write to a file all the time, but I will put this on the todo list cause it could help with chunks loading slowly upon first teleporting. This might spawn database caching instead of the current file caching system to save player data.
It's quite bad when you're on a large server and accounts for lag spikes a lot.
If you look here ^ it's almost a MB which makes the saving time not trivial
Ouch yeah, Ima have to move player data to a sqlite database, wont be easy, but its all asynchronous and low on memory when searching and I wont have to load the whole file at once. I will see if I can implement a way to transfer the data over automatically as well, cause some servers are large and most people dont read the patch notes
Yeah that's a good idea, thanks Ronan!
I decided to have a go at fixing it myself, or at least creating some sort of patch for my own use and I realised that you've also effectively created a memory leak as you're loading the entire file at boot rather than as players join, this means the more and more offline players a server accumulates, the more memory is used.
Ha, thank you, I was working on doing a complete rework, this will save me a good amount of time. The memory leak I was aware of, but I do see how it could be an issue on large servers, I will be replacing this with a SQL database VERY soon, just haven't had any time to sit down and program lately.
Alright, this has finally been fixed in a build I have been working on, I have moved all Cooldowns to save and load asynchronously. I will be releasing this build very soon after plenty of debugging ;)
Was able to completely debug and seems like everything is good to go, please let me know if you find any issues with the new cooldowns saving method ;)
Awesome, thank you Ronan!
BetterRTP is saving to files on the main thread, this has consequential effects on server performance. Here it is shown to be using 16% of main thread.