MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Perf regression in UpdateLineVisuals

Open Zee2 opened this issue 3 years ago • 1 comments

Describe the bug

MRTKLineVisual.UpdateLineVisual is allocing 2 KB every frame, even when no hands are even visible in the scene.

image

To reproduce

Open empty MRTK scene. Run scene. Check profiler.

Expected behavior

No per frame alloc, especially not when the rays are even visible!

Your setup

  • MRTK3 latest

Zee2 avatar Jan 04 '23 22:01 Zee2

Digging into this issue also revealed that we'd get a bunch of gc alloc costs when active holding a selection on an object in the input simulator. This is because our selection value would never quite hit 0 or 1. The PR #11344 adds a deadzone to the input simulator to allow the axis value to finally reach the target value of 0 or 1.

RogPodge avatar Jan 05 '23 22:01 RogPodge

Tested - no repro. No per frame allocations now. Looks like the above fix worked.

shaynie avatar May 25 '23 19:05 shaynie