Will Xcode compile more Swift files in parallel if you have more cpu cores? - xcode

When building a project, I can see Xcode working on 4 Swift files at the same time in the Build Log inside the report navigator.
I also see that there are 4 processes in Activity Manager, all called "Swift", when it's compiling.
It seems to be doing a great use of the available processing power to do it's job, so I'm not looking to change that. However, i'm working with a Dual Core i7 processor.
Would a Quad Core i7 be able to compile 8 files in parallel? And if so, would it also scale up if it were 6 cores?
Could someone with at least a Quad Core do a test to confirm this?
I'm using Xcode 6.3.1
Thank you!

Xcode will use as many available processors as it can. There are some situations where it cannot use all processors, for example it cannot compile Objective-C files until all precompiled header files are compiled, so if you have one precompiled header file only, then only one processor will be used for that. But for all your normal source files, all the processors will be used. And for the static analyzer, all the processors will be used as well.
In other words, the quad core Retina MBP 15" is a very fine development machine. Give it lots of RAM if you have large source files, I had problems with 8 core MacPro with 4GB of RAM (long time ago). An older Mac Mini with four cores is also quite useful.

This is the CPU Usage on my MacBook Pro with the Apple M1 Pro during the normal thinking-typing-thinking-typing work that takes up 99% of my work day. The two cores on the left are the efficiency cores and the 8 on the right are the performance cores. It spends most of its time just like that. And there are a dozen apps open.
And when it’s time to see if that thinking-typing amounted to anything it’s nice to see all 10 cores max out while the app builds. That’s cool.

Related

Slow xamarin build in visual studio 2017

I am of recently developing a Xamarin based app in Visual Studio 2017 and I am not sure whether the performance I see at a build and debug time is what can be expected or if something is wrong.
Environment: imac late 2015, quad core i5 #3.5GHz, 24GB RAM.
I am executing visual studio (latest) under parallels 13 in windows 10 and have assigned all four cores and 20GB RAM to the VM (it doesn't make a difference though if I assign less).
The solution is a standard xamarin based solution with 3 projects and about 10 classes with roughly 300loc (yes really, there's almost nothing in there yet).
A rebuild takes about 1 Minute. Starting the application in debug mode takes about 30s for the simulator showing up.
Looking at the code size and hardware specs I was expecting build and simulation to be a matter of seconds.
Am I wrong? Even considering the VM I'd not have expected these numbers.
Is anybody able to share experiences/thoughts?
Your problem isn't simply compile time. Every time you build your project, your shared code gets compiled into a dll, code dependencies get checked, then linked into the native project, which is being compiled, resources get packed, integrity-checked and signed and is finally being bundled (not speaking of included nuget Packages and other plugins) and then the whole package gets packed into an app archive, which also needs time to be written.
Also your app gets transmitted to your device via USB or network (default would be USB).
Considering what is happening "under the hood", 30 seconds is quite fast.
However, I have found that the performance is less based upon cpu and ram (at least if your dev machine has a decent amount of both) but on the performance of your hard disk.
If you really want to speed things up, you might consider running visual studio and doing your compiling on a nvme drive (an alternative might be a SSD raid).
For instance I once had a xamarin app, which had a lot of dependencies on various nuget packages. Compiling the iOS Version took about 25 minutes (full rebuild) on a Mac Mini (2011 model improved with an aftermarket Samsung 850 Pro), switching to a VM solution running on a skull canyon NUC equipped with a Samsung 950 Pro nvme drive did speed up the process to incredible 2.5 minutes.

Can Xcode utilize 64GB RAM or greater?

I have a MBP with 16GB of RAM. As projects grow in Xcode, the compile time does take longer. I'm looking into starting a hackintosh project purely for shortening Xcode compilation time. Since RAM is cheap, I wanna push the normal boundaries. But the biggest question is will Xcode be capable of using all the RAM greater than 32GB? I know there will be some diminishing marginal returns at some point of RAM increase.
RAM usage is mostly governed by the OS, because the Mac Pro does support up to 64GB of RAM, so should OSX (and by extension XCode).
Although I wonder if your compile time issues are actually RAM-related. I have Xcode projects that take minutes to build and it's all because my CPU is pegged at 100% (using a mid-2015 15" retina MBP). Not many software projects are RAM-constrained past 16GB.

Android Studio on Dual Xeon Workstation

Curious if anyone out there is doing Android Studio development on a dual Xeon machine.
I would like to know if the additional CPU gave a dramatic or visible (50% or more) boost in build performance.
You probably found out, but for others wondering: Chances are - it won't.
Did some testing with two relatively quick E2650 v4 Xeons on a largish Java + Kotlin project and Xeons were considerably slower than low core count / higher clock CPU's.
Check out the benchmarks here:
https://superuser.com/questions/1115206/will-dual-xeons-improve-android-studio-build-times/
I have tried to measure speed of Android Studio 3.1.4 on the same hardware: Macbook Pro 2011, RAM 4Gb, SSD 240GB Samsung, Core i5 2.4Ghz.
I have installed on this machine 3 different OS: Windows 10, MacOS Hight Sierra 10.13, Ubuntu 18.04.
Avarage build time (running command: gradlew clean build, gradlew clean assembleRelease) on MacOS/Ubuntu was around 30% faster than on Windows.
On my another working machine: Core i5 3.0 Ghz 7400, RAM 16Gb, SSD 250Gb. Build time takes 4.34min on Windows 10 machine.
The same project on a little bit slower processor, but with the same RAM and SSD and it is running Ubuntu 16.04 build time takes two times faster!!
Well I was shocked with results, but still I choose Windows as development machine, because it's much more comfortable for me to use comfortable and
usable keyboard and sotfware than on Unix like systems. And even if I had to choose between MacOS and Ubuntu - mac is really much easier to setup everything, and
Ubuntu is too complex to use for usual people. Choise is up to you.

Android Dev Kit in Eclipse

So I have a few issues with Eclipse and Android Dev Kit.
First of all Eclipse is being unbelievably slow and sometimes it renders it really useless. (It even lags switching the tabs!!!.)
I tried modifying the .ini file and tried allocating it even as much as 2gb-3gb ram. Still no improvement.
Is there any way to get it up to Visual Studio efficiency? When I'm debugging and I want to view a value inside a class in the watch it lags to display a simple 2 digit integer! Seriously W*F is up with that? VS instantineously displays 100s of objects in a collection with no lagging.
Also debugging is really slugish and it is really annoying! Steping from one line to another takes about 2 seconds!
My laptops has this spec:
Core i7-2670QM 2.2GHz (turbo up to 3.1GHz)
8GB DDR3 RAM
500GB HDD
GeForce GT630M 1GB (Dedicated)
This laptop handles some of the most demanding software and games without an issue and Eclipse lags!
Another issue, when I launch the Android Emulator my sound drops by around a half (for everything.) I use the internal sound card (integrated.) Any idea of how to fix it?
Thanks very much
Daniel Wardin
I fixed the issue after deleting everything to do with Eclipse and installing the x86 version instead of the x64 and the performance is a LOT better now!
It must be a design fault in the IDE.

XCode compiling extremely slow inside VMWare

The OSX 10.6.6 is installed inside VMware on Windows 7 host. The overall performance is great, However, the compiling time increased dramatically (1 hour against 2-3 min on pure MacOS). It's modern machine with Core i5 & 4GB RAM.
Here are the XBench results:
http://db.xbench.com/merge.xhtml?doc1=517768&doc2=1&setCookie=true
I think the problem could be in extremely slow 4k write value, but I don't know how to improve this.
Is there any way to increase performance?
UPD1: swap is not used, there is enough memory for all operations
the disk speed is also not related, since my another Macbook shows event worse results, and compiles hundreds times faster.
UPD2: problem solved, see my answer below
Sharing experience and solution.
My Xcode was running fine but when I build a project (even an empty one), it would take up to 10 minutes.
SOLUTION:
Go to Xcode -> Preference -> Source Control: Dissable Source Control
Now projects build and run in a matter of seconds.
In VMWare, you should have a setting where you can dedicate one or two cores entirely to the virtual machine. Assuming you have quad core, maybe give MacOSX 2 or 3 cores? If you have dual-core and you've allocated 1 core to the VM (and the problem still persists), i can't say much then!
It's good that your problem is solved, but I want to share my experience for improving vmware performance. Please do install VMware tools for mac os and they are present in .iso file.
Steps to install VMware tools for MAC OS:
1) Power on your VM.
2) At the right bottom they are some pop-up symbols(These are usually not present in full screen mode). Rightclick the CD/DVD symbol.
3) Click setting. In this window make sure that darwin.iso is selected.
4) Close this window and again right click CD/DVD symbol.
5) Click connect. An icon will appear with name darwin(300).
6) Inside this file tools are present. Install them!
The problem was: VERY SLOW recursive searching of include paths. If non-recursive, everything works smooth.
I also got the same problem, But i want share my personal experience here.
My CPUs RAM capacity is 4 GB, So i allocated 3.5 GB to the VMWare
because of this it was very slow the entire operating system.
So one day i clearly observed the VMWare settings, finally found the
solution. If we allocate the RAM memory more than recommended then
also your operating system hangs. For my System the recommended RAM
memory is 2048MB, after adjusting this now OS is fast.
We can adjust the RAM memory in Devices option, inside Hardware. For
clarification here i am attaching the screen shot.
I had the same problem and I fixed it as follow:
Most boost I got with changing my vmware config file to disable memory
stored in .vmem file. In my .vmx file I added :
mainMem.useNamedFile = "FALSE"
prefvmx.minVmMemPct = "100"
Setting max cores to the guest
When programming with swift and XCode. Remove all comments /* */ not really used.

Resources