A lot of people equate memory (or lack thereof) to performance and that's wrong in most cases. This is because the word 'performance' is overloaded in most cases.
If you have 8GB of memory and are doing photo manipulation of RAW files, you're going to see issues because the application is going to have a hard time keeping enough of the data in memory for manipulation and constantly swapping data between memory and the hard drive. In this case, increasing memory to 32GB or more will greatly benefit this use case.
If you have 8GB of memory and are compiling a complicated program and if the CPU isn't up to the task, the performance issue will manifest as very long compilation times. In this case, using a faster/better CPU will benefit the this use case.
It's important to match the machine (CPU, memory and so on) to the use case.