Search Unity

OverlapAreaNonAlloc 3 times the computation time as equivalent Box2D function

Discussion in 'Physics' started by joshuacwilde, May 20, 2020.

  1. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    731
    As you can see here, the function that Unity is wrapping is Box2D's "QueryAABB".
    You can also see that QueryAABB is 1/3 the computation time of OverlapAreaNonAlloc.

    I'm confused that this wrapper would cause so much overhead. Is there anything that can be done to fix this? This takes up over 15% of my computation time right now for the project I am working on.
     

    Attached Files: