InputActions are very slow (?)

Finished updating from old input to new one but performance looks pretty bad.

Devices are also slower:

Windows il2cpp:
Input.GetMouseButton(0): avg 3.091, median 3
Mouse.current.leftButton.ReadUnprocessedValue() > 0: avg 11.085, median 12

After adding few [MethodImpl( MethodImplOptions.AggressiveInlining )]:
Mouse.current.leftButton.ReadUnprocessedValue() > 0: avg 8.123, median 7

Mono:
Input.GetMouseButton(0): avg 1.027 , median 1
Mouse.current.leftButton.ReadUnprocessedValue() > 0: avg 2.557, median 3


Keyboard with Mono :
Input.GetKey(KeyCode.A): avg 1.601, median 1
Keyboard.current.aKey.ReadUnprocessedValue() > 0: avg 3.236, median 2

Update:

Looks like slow actions come purely from “Deep Profile” option, disabling fixes the issue:

Post 2 is still true but it’s only few ticks. @Rene-Damm any thoughts on adding [MethodImpl( MethodImplOptions.AggressiveInlining )] to most frequently used methods/getters? Calling method in il2cpp without that tag is up to x15 more expensive. After showing benchmarks for Unity.Mathemetics pretty much everything got tagged Unity.Mathematics/src/Unity.Mathematics/math.cs at master · Unity-Technologies/Unity.Mathematics · GitHub