Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Discussion Analytics flush is too expensive for standalone VR

Discussion in 'Unity Analytics' started by levi9000, Dec 25, 2023.

  1. levi9000

    levi9000

    Joined:
    Jan 25, 2014
    Posts:
    11
    While profiling my VR game on the Quest platform, I caught a few spikes related to the analytics service that can cause frame skips. From my profiling, it looks like the flush command runs on the main thread, hand-serializes the data into JSON and into a newly allocated buffer, and opens an HTTP request. I had VERY FEW events and it took > 6ms, which guarantees a dropped frame. Then a few frames later, another spike when the HTTP request completed which was > 4ms while it was putzing with the file system.

    The documentation says:
    Events are recorded into a buffer, which is flushed to the server every 60 seconds and on app shutdown. This period is not configurable.​

    Is this true? It all but guarantees I drop a minimum of 2 frames every 60 seconds?

    Is the package at least open source so I can clone it and patch it? I cannot find it on Github.