New input system has big overhead for gamepad.

Hello. I attached the profiler to a build and saw some weird behavior. I am using L2CPP as backend, the build isn’t in Deep Profiling mode and I am using the new Input System.

When pressing the buttons on the gamepad, this “inputCheckForUnpairedDeviceActivity” method is called. I don’t know what that is, but it seems to be taking up to 1 ms to trigger the event, this is unacceptable. It seems to be happening only with the gamepad not with the keyboard. Any ideas?

To accept input I have a “Player Input” component attached to a GameObject that is invoking Unity Events. I am handling the events like this:

    public void OnAttackButtonPressed(InputAction.CallbackContext context)
    {
        float input = context.ReadValue<float>();

        if(input == 1)
        {
            OnAttackBtnPressed?.Invoke();
        }
    }

    public void OnDashButtonPressed(InputAction.CallbackContext context)
    {
        if(context.ReadValue<float>() > minRightTriggerSensitivity)
        {
            OnDashBtnPressed?.Invoke();
        }
    }

And my input action controller(?) looks like this

Am I doing something wrong?
Thanks in advance.

I am seeing the same issue here on Unity 2020.3.9f with InputSystem 1.0.2 unfortunately.
This looks like internal InputSystem code checking for new unpaired devices is causing heavy allocations.


182702-screenshot-2021-06-27-230926.png