I will try add more info later. (other platforms and bundle). Not sure mb it is my platform issue.
1)When i start my game i always have strange frezze. After 3-4 second after start. It about 170-190ms
2)I spend some times, and catch it in html profiler.
3)It is a vsync. wtf?)
It could definitely be garbage collection! Perhaps you are generating a lot of garbage during setup which gets cleaned up after a few seconds?
You can trigger garbage collection manually and also tweak the collector (using the collectgarbage() function and its argument). I haven’t made any extensive experiments with the garbage collector so I can’t give much advice.
Thanks. I already try collectgarbage. After init collection loaded, and after game scene started.
But nothing change. I will try more experiments with gc.
Also I try not load game scene. And get same frezze.
I use a lot of lua modules in init. Mb some generate garbage. Also will look.
It would be useful for sure, but I think it would require quite a bit of work and require changes to the Lua versions we use. @JCash might have some insights into this.
The GA SDK sends all events from a separate thread. I have tested in a Windows build and I don’t get a freeze in the game. I am not sure what goes wrong
Ok thanks for the videos and test project. I tried to adding the show_dt code to my test project and also an FPS counter. I see small dip when initialising the SDK but after that FPS is steady when sending events. This the project I have used to test with: https://drive.google.com/file/d/1SX7jf9pilMHq3RQo8kh4YO7og5AxCTXr/view?usp=sharing
I only seem to get frame rate drop on initialzing the SDK but not when sending new events after this. I have double checked that the SDK codes is run on a separate thread. I am not sure if it has anything to do with libcurl or what is happening. I have tested the same c++ library in our Unreal SDK and here there is no frame rate drops. I am not sure if anyone has any suggestions what could be wrong?
We used to have problems with DNS lookup (using getaddrinfo()). It was the only part of the connection process that was blocking and on a bad network connection there was a noticeable stall. Could it be something similar.
If I comment out res = curl_easy_perform(curl); in our native C++ lib there don’t seem to be a frame rate drop, but it is only for the first request it happens. When sending events after there doesn’t seem to be an issue.