My current computer (a mid-2010 Macbook Pro, with 16GB of non-native RAM and a non-native SSD) is struggling to cope with the most recent incarnations of Xcode (currently running v9.2). Build and Run commands are still executed in reasonable time, but the speed with which I can write code is at times so slow that I'll be close to tears!. For example, although it takes me just a few seconds to type two or three lines of Swift, it can often take Xcode a minute or more to get the text onto the screen (a stand-alone Dell monitor connected via a mini-display port cable).
The problem seems to be that the autocomplete/code-sense features of Xcode are stretching Xcode to breaking point - the fan starts up within minutes of starting work, and generally don't stop until I do. The standard advice for remedying this (deleting derived data) has little impact. What's more, although restarting the computer does have some effect, it's not long-lasting, and isn't a long-term solution.
I'm at the point now that I'm willing to fork out for a new computer but want to spec it wisely: spending extra money only on upgrades that will make a difference within Xcode. To my untrained eye the choice seems to be between getting extra RAM, a faster processor, or both. Am I right about this? If I am, what should I do? if I'm not, what am I missing?