Maxallica 0 Posted October 10, 2022 (edited) Hello DayZ modding community, I am new to the Day-Z modding scene and need your help. I have a lot of experience with programming C# and Java (Apps / Web-Applications), but unfortunately I am not that familiar with the script framework for DayZ and the IDE "Enfusion". Specifically, it is about my created community mod GAREA_Leaderboard:GAREA_Leaderboard Many players have left me a good feedback and think it's great that I provide and develop my mod(s) completely free for the whole Day-Z community. However, some Day-Z server operators have reported to me that they have performance problems as soon as a total of more than 500 players (online/offline) are registered on the server with my mod. When loading a leaderboard (PVP/PVE) the clients hangs (is lagging), because the client waits until the server has processed the request. Basic concept of my mod: - All the player data I collect is stored in JSON files directly at the Day-Z server. - When starting the Day-Z server all players (all JSON files) are loaded into an array. - When a player logs in / logs out, the player is either created (if not present in the array) or updated as either online or offline. - On a player action (kill / death, etc.) the specific value of the player inside the array is changed and will be saved. - At a client request to the server only the data for the respective category PVP or PVE will be loaded (To minimize the amount of data) - Afterwards these data are displayed at the client The client-server request works via the CF frameworkCF I was also able to find out and recreate this performance problem myself, unfortunately I don't really know how to solve this problem. When requesting from a client to the server for the leaderboard, all players both offline and online are sorted by deaths (desc) and then by kills (asc). This loop sorting takes longer or shorter depending on the total number of players. (With a smaller number of players it is not noticeable at all ~100). I have already tried to start the processing of the server request with the term "thread". However, this term does not fulfill the property I wanted/used to. (To let parts of the programming process async in the background without locking). Also, I couldn't find any way in the framework to store data into a SQL(Lite) database. That alone would reduce the processing time. The only way around this problem, I think, is to set up a own REST API server with its own database. But this would be an additional application or monolith for server operators and I would not like to do this, because I think that all data should be processed directly at the Day-Z server side. Do you think there is any solution to run the data processing async in the background without locking on the server side? Feel free to take a look at my mod or unzip the PBO file if necessary. Thank you very much in advance. With kind regards Maxallica Edited October 10, 2022 by Maxallica Share this post Link to post Share on other sites
Maxallica 0 Posted January 27, 2023 (edited) I speed the mod up via changing the sorting algorithm from BubbleSort to QuickSort. Edited January 27, 2023 by Maxallica Share this post Link to post Share on other sites