Really bizarre issue here; I suspect it's X-related. This may be better suited to the Linux/Unix SE, but I figured there might be more domain-specific expertise here.
Often (but not 100% of the time), if I run Emacs and Chromium (or google-chrome, I'm on Ubuntu) at the same time, then UI updates on Emacs take ages to show. As in, I'll try to scroll around the package menu and it will take 45 seconds to render a few dozen lines worth of scrolling. It seems to go both ways: I'm updating 31 packages in the background as I type this and there's a few seconds of lag between every character I type and the on-screen rendering.
This issue occurs with both
emacsclients and stand-alone Emacs sessions. I have 6 cores and I see that only one of them is being used at the moment, which I think must be the cause of the issue. I 'm only at 60% memory usage with almost no swap space being used, so it's not a question of the system being over-taxed.
It looks like the lag spikes correlate with CPU-intensive actions in Emacs. It's almost as if chromium and Emacs have decided to run on the same core and compete for cycles, but I can't imagine why.
I'm on the latest Ubuntu release, via Xubuntu, and I use XMonad as my window manager. I've never had any other pair of programs have this kind of issue. Firefox doesn't cause this problem, I only discovered it recently after switching to Chrome. What's going on here?