Don't know your use case since I don't use XCode nor have an idea of your project's size, but it sounds like a software bug to me if your projects are light or don't use a lot of hi-res graphics and animations for the GUI. I stopped using Chrome less than two or three months after getting the M1 Air because it was taking way too much RAM space when compared to Safari. No performance hits, just bothersome because I read about it around the web and started monitoring it and confirmed it using Activity Monitor. Google probably has sorted this bug out by now. I just don't care for that browser anymore. As a parenthesis, reading all the comments on this and other threads... a lot of users have really bad computer usage habits, or don't know how to troubleshoot a platform let it be a Windows or macOS PC. That's the real "tragedy" simplified devices like tablets and smart phones left behind. I'm not saying you are one of them.Great, but what about Swap? Only launching Xcode on this machine M1, Air, 8gb RAM, 256gb SSD, make Swapping up to 20gb. That’s huge! I’d a chance to talk one of the Apple technician, and he confirmed, they received a lot of macs M cpu series because of dead logic board (ssd).
Now, for the workload I posted, the swap file size was around 2.86GB. I've had this laptop for maybe a bit more than a year and a half, no problems at all regarding SSD performance or reliability, and don't use external drives for recording and virtual instruments samples or loops. I do use it unplugged a lot, and even though I have not noticed CPU performance hits while on battery, the health indicator today states the battery is in normal condition with 86% charging capacity. When new, I remember a single charge could last me for 2 and a half days even when powering my USB audio interface for a couple hours at home at night. Now it's down to one and a half days. 6 to 8 hours once or twice a week if workload was really heavy AutoCAD usage and video editing during the day. The main tasks I use the laptop for are AutoCAD 2D with mild 3D drafting, spreadsheets, word processor, and photo+video reports for MEP project management. Music I do as a very involved hobby and revolves around Logic Pro and Live as DAWs, NeuralDSP guitar/bass plugins, Arturia V collection virtual instruments, a bunch of Waves analog emulation plugins, two MIDI controllers (Arturia Keylab 61 MKII and a Launchpad X,) a 4-input USB 24bit/192KHz interface, 2 condenser mics, 2 Presonus monitors, and one dynamic mic. I've been able to record real drum kits, real guitar and bass amps, voice and all, as well as writing complete arrangements using only virtual instruments. This laptop handles all of it quite well with very little CPU usage and no SSD stress. If I were to use heavy sample libraries and more than 8 audio inputs, yes. I would definitely get a +16GB RAM laptop. But I don't, which is the real point. 8GB is more than enough for me.