Closed tommy-mor closed 1 year ago
The stuttering is not related to uploading, since that is indeed done in a background thread. It is related to some of the file operations being done by the plugin. I am looking into splitting the workload into smaller chunks, to avoid stutters.
you could probably just make a timer to do all the work
that would make it take 90 seconds to get logs uploaded but also like, whatever? definitely an easier solution than setting up threads or async bullshit in sourcepawn, you would have a better time doing it in C++ as an extension
alternatively you could write (flush) the log every x
seconds but i dont know if that would actually be a good idea, might introduce microstutters
I'm not sure the stutters are still happening. Last match I watched I couldn't find them. Would be worth recreating them to make sure that it's a real thing still
you could probably just make a timer to do all the work
+ 5 seconds after the game_over event lol
This doesn't solve mid-game uploads. If we wait 90 seconds, it would lag for the players on the server.
you would have a better time doing it in C++ as an extension
Unless there is a default extension which can already do this, it would require every server owner to install an extra extension. I would rather not require that. (And besides, I wouldn't want to develop and maintain an extension.)
alternatively you could write (flush) the log every
x
seconds but i dont know if that would actually be a good idea, might introduce microstutters
The issue is not writing the log, but the file operations happening at the time of upload.
I'm not sure the stutters are still happening. Last match I watched I couldn't find them. Would be worth recreating them to make sure that it's a real thing still
The stutters have always been there, and it is easy for me to recreate them on my own machine.
I have worked on a fix that will reduce the risk of stutters. Here you can see it in action - there is a clear stutter 1 second into the video, which is not visible with the new plugin.
Once I have finished testing, I will release it. (#24)
phenomenal work
in the sourcemod built in sql plugin, it allows for running the queries in the background to avoid stutters.
https://wiki.alliedmods.net/SQL_(SourceMod_Scripting)#Threading
in the mgemod source, all of the sql queries take callbacks, as they are executed in background, avoiding stutters.
logs upload method http req does have a callback, but i'm not sure if it's running the request in a different thread. I don't understand cpp/sp enough to say if the steamworks http lib runs the thread in the background.
In some matches with the default rgl config, there is a noticeable stutter as a client to the server, as well as the stv on round end. From the stv, this is undesirable as it spoils the result of the upcoming last push. Is a synchronous http request from
logstf_midgameupload 1
the culprit? LMK if i'm missing something