Xcode requirements

Hello, I'm looking for the mac requirements for Xcode. The problem I have is that I have installed Xcode on my iMac 2017 21.5 "4k, 8gb of ram and 1tb hard drive and when I launch xcode the whole mac becomes very slow, almost freezing. If I try to preview the written code (for example: hello world), nothing ever appears and the mac loads for a very long time and almost freezes. As soon as I uninstall or exit Xcode the mac goes back to being fast. I looked at the activity monitor during Xcode, but the memory used remains normally, the only thing that comes to my mind is that it could be the hard disk, if I replace it with a 512gb ssd would I solve the problem? Thank you very much, I look forward to your kind reply.

4k, 8gb of ram and 1tb hard drive

I think the problem is RAM size.
With Xcode 10 and over, you need at least 16 GB.

How much disk space available. If you have more than 100 GB, that should be OK
I have 950gb free on the hard drive. I looked at the use of the ram in activity monitoring, while xcode is running, but at the max it uses 6gb of ram, the ram usage line is always green. Do you still think it's a ram problem?
You use 6 GB for Xcode alone ?

In that case, yes, I fear there is a lot of swapping, which causes the slow down.

In my case, a few years ago (Xcode 8 probably at the time), my iMac became really slow. I added RAM from 8 to 24 GB.
Major improvement.

If you extend memory, I advise you to install 32 GB.
Note: on Mac 21.5", I read that memory upgrade must be done by Apple technician. Check before buying.
Ok, so do you think it depends on the ram memory? and not from the hard disk? Thanks a lot

Ok, so do you think it depends on the ram memory? and not from the hard disk?

If you have 950 GB free on a total of 1000 GB, that is not a disk space issue.

It is not either a processor speed issue (My iMac is 2015 and works OK with Xcode 12.

So, the most likely is the RAM. And definitely, 6GB used over 8 GB (you have other processes to run as well) means you are reaching the limit and are going into (slow) swap operations.

So answer is YES, I think it depends on the ram memory
No I did not understand the disk space, but from the slowness of the hard disk (hdd) I have, I thought it would be enough to install an SSD to solve the problem. However as regards the ram memory, when I open xcode, I only have that app open, if I open Safari together, for example, it crashes or everything goes very slow ...
SSD would speed up, but not to the level you seem to expect.
And HD slows down mainly if you have to swap from RAM to Disk.

So at the end, we fall back on RAM capacity.

My advice: if you can have access to an Apple store, ask them what are the options and cost to increase your Mac 21" at least to 16 GB. And if not too expensive, go for 32 GB.
I put a 512gb ssd and now it goes, loading is not immediate, but at least part of it. Thanks a lot
Thanks for feedback.

Do you have any factual measurement that allow to evaluate the level of performance you reached, with and without SSD ?

It is logical SSD improves performance (how much ?), because it speeds up cache operations.

BTW, that just proves, IMO, that you have a lot of swapping.
Larger RAM would eliminate the swapping "totally".

 loading is not immediate,

I checked on my iMAC, with 24GB: Xcode 12.2 launches in between 2 and 3 seconds (before the initial screen shows up).

Mine instead starts up in 2 seconds (before the splash screen is shown). I have 8gb of ram, 512gb ssd, 2017 21.5 "4k imac.
Xcode requirements
 
 
Q