I have the same problem, but I’m unsure if it’s only due to repeated keys. The repeated key always creates a lag if I do it for enough long (forcing it), but more than often, it happens during my daily writing and is so distracting as the lag is a couple of seconds. Below a screenshot:
I opened another issue as I thought it was related to it (https://forum.obsidian.md/t/typeerror-cannot-read-properties-of-undefined-reading-length/), but it happens more often lately. So still trying to find out, but this key repeat definitely happens on my very persistently.
Here is a performance log of a couple of second where it lagged a lot:
slow on keypress - Trace-20240820T130958.json.zip (3.1 MB)
UPDATE (27th August): I have deleted lots of Plugins, especially old ones and also new ones I just installed, like Lazy loading with BRAT. Although the lag was also there with restricted mode, I can now confirm the lag is gone. Also on another note, I think I tested always with the Developer Tools open too see what happens, I think that in itself produced a lag (obviously the initial lag was not due to it, but my debugging was mostly done with that open).
I can’t point it to one specific Plugin, but it might have been that lazy loading could have been too new, or also did something with plugins that were started delayed. But that’s just a guess. For now, I have not installed it.