Recast Linecast performance - Editor vs Build

My code is doing several hundred linecasts per frame which takes several ms in editor. However when I make a build, it’s far less. I moved from 2019.4 to 2020.3 to see if this was Burst in-editor improvements, and it cut it about in half in editor. So for example, the LateUpdate where it’s being run was 27ms in 2019.4/editor, 15ms in 2020.3/editor, and 5ms in 2020.3/build.

My questions:

  • What can I do to optimize linecast perf on a Recast graph?
  • Is there a later Unity version where Editor perf is closer to build perf?

Thanks!

As a follow up, I switched this back to Unity Navmesh and Navmesh.Raycast and the performance impact is negligible in editor and build. I do like the flexibility of Astar’s Recast graph generation though, so if you have any tips for me I’d be very happy! Thanks.

Hi

Not much to do, I’m afraid. I’ve tried hard to optimize the linecasts in this package. But there’s only so much I can do in managed C#. If at some point I rewrite all graphs to use burst for their data storage there could be a large speed boost.
I think in the Unity editor there are some options you can disable to make code faster. I can’t remember what it was called exactly, but something related to allowing a debugger to attach to the code.