Unity 2022.3.8f1
I've recently started using Steamworks API (Steamworks SDK 1.53) via Steamworks.NET (a C# wrapper). However I am now getting some spikes in frame times when running from a build (running in editor is fine).
If I turn off logging, i.e.
Debug.unityLogger.logEnabled = false;
then I no longer get the spikes in my build. The thing is even with logging enabled there is barely anything in the player.log, and also its the same log messages as were there before starting to use Steamworks API (and note before that everything ran fine).
What could the Steam API be doing that means that turning logging on
Debug.unityLogger.logEnabled = true;
means we are getting these spikes in frame times? Is the Steamworks SDK doing a bunch of extra work behind the scenes if this is turned on (and not even logging it to player.log)?
Also note this issue occurs both in standalone build run directly on PC as well as build run through Steam. Running in unity editor is no problem.
Any advice much appreciated. Thanks.
Edit: I ran the profiler and it seems just regular logging of a single message (completely unrelated to steamworks api) is taking like 100ms! No idea why steamworks api is effecting regular game logging that has nothing to do with it like this
these guys seem to have had some success trying on different machines: https://forum.unity.com/threads/heavy-lags-due-to-steam-integration.1151912/
can you paste the code you use to connect to the steamworks API?
Alternatively you could try using this:
https://github.com/Facepunch/Facepunch.Steamworks
https://www.reddit.com/r/gamedev/comments/68mndv/comment/dgzvzwh/