Search Unity

Async updates spending way too much time on main thread

Discussion in 'Navigation' started by snacktime, Aug 22, 2018.

  1. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Stalling the main thread for 280ms is a bit much. Also strange that it's showing up under Render.OpaqueGeometry in the profiler.

    We have had some nice stuff coming in on the query side for jobs, any chance on getting some love on the building side?
     
  2. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
  3. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    That's all fine and good but the core problem is the job being completed early.
     
  4. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Also build settings influence quality of the end navmesh. You can easily end up with corners being cut, etc.. if you just tune for build performance only.

    Having some experience with Recast I can't think of a reason why they would need to complete any recast work on the main thread. So I'm thinking it's likely just naive job logic that completes every frame regardless of how much work is left. Which would not be a horribly complicated thing to fix if it is something like that.
     
  5. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Unfortunately it's 90% buried in secrecy. God forbid they let us try to improve it.

    It doesn't make sense to me why changing tile size would affect more than a ms or two, but changing it made a huge difference in my render time and doesn't affect voxel size.

    Also grabbing sources using a null mask to setup the data before telling the AsynchOp to grab the actual sources had a noticeable increase in speed for me:
    https://forum.unity.com/threads/navmesh-baking-at-runtime-example.507446/#post-3401247
     
    joshcamas likes this.