I noticed when I switched from Objective C to Swift on my Mac Mini that it was taking significantly longer to compile the programs.

My Mac Mini had 4Gb ram, so I upped it to 16Gb ram and now compiles are pretty quick.

I got the ram from Crucial rather than from Apple as they are a lot cheaper.  Fitting the ram to my late 2012 Mac Mini is dead easy as well, just a 5 minute job.