A very basic setting, yet easily overlooked.
Since upgrading to Ableton 12, I've had the issue that Ableton was lagging horribly on random occasions.
I could have a session with no performance problems, but then, out of the blue, after doing any button-/click-based action (freezing tracks, saving, loading a plugin, viewing a plugin, adding a track, deleting a track etc.), the performance would plummet to unusable levels - every action would take 10-30 seconds to load and playing back your track would sound like time stretching it x500.
This would happen over and over again, at random points in time, but always after a button-/click-based action. And the CPU meter would never show more than 10-20%, most of the time below 10%.
Tried a lot of things to fix the issue, from checking plugin compatibility to killing all background processes. Nothing worked. At the end, simply adjusting the sample rate from 48kHz to 44.1kHz did the job. Not sure why, as I used 48 kHz in Ableton 11 without problems as well, but it worked.
So, if you run into similar issues, be sure to play around with your sample rate and/or buffer size, and see if it solves the issue for you!