Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug Changing InputSystem.updateMode at runtime causes MASSIVE lag spike in both Editor&Build.

Discussion in 'Input System' started by pastaluego, Aug 9, 2023.

  1. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    193
    Whenever I try to pause my game I get this
    upload_2023-8-9_15-11-40.png

    Changing InputSystem.updateMode at runtime when I pause and unpause causes massive lagspike. But I need to do it, so I don't know how to avoid it. I need my gameplay input running at fixedupdate and I need my UI input running at dynamicupdate.

    But I don't get why it's calling TryFindMatchingControlLayout 7300 times on the frame that happens (24B * 7300 = 175KB memory allocations).
     
    Last edited: Aug 9, 2023
  2. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    193
    upload_2023-8-9_16-2-54.png

    That's what deep profiling shows.

    And it's doing that call 30 more times on the frame updateMode is changed.

    Is there not a way for it to simply use the existing controllayout when changing updateMode? Why does it have to look for it again and look for every device.

    This is happening at build-time too, not just editor. If trying to deep profile changing updateMode, the build stalls for 3000 milliseconds.
     
    Last edited: Aug 9, 2023
  3. yyy1990

    yyy1990

    Joined:
    Jun 2, 2023
    Posts:
    1
    your unity version?? That's what I do,but I dont get Calling tryFindMatchingControlLayout