I’m running on an intel-nvida system, using Optimus. When Optimus is set to Nvidia with no external display attached, I have issues with input devices, namely the trackpad or mouse and the keyboard. When doing something, the system freezes for a second, then duplicates the action. For example, when typing, if I stop for a short time, and then resume typing, the first character lags a second then it appears duplicated. This does not happen either with Optimus set to use the Intel card, nor when I have an external display attached when using the Nvidia card.
Please start libinput debug-events, that should give you timing information about input events, based on that you can determine if the input events or the GUI stack lags. You should also check if there are relevant entries in the journal: journalctl -b | grep "event processing lagging".
journalctl -b | grep "event processing lagging shows no output.
In libinput debug-events I see the timing but not sure what I should expect. There is some lag when hitting a key, but then the output prints OK (with the same lag as the actual input event happening). Sometimes pressed events are duplicated, but not always. Sometimes I get a duplicate character while typing but there’s a single KEYBOARD_KEY ... pressed event logged. Sometimes they are duplicate. It’s not very consistent.