Dorico becomes very slow after a while...

Paul describes a way to disable midi devices manually in this post:

Note that you’ll need to find the correct name of your midi device. Daniel describes a method for this right below Pauls answer.