Slow xamarin build in visual studio 2017 - xamarin

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.

Related

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

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.

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.

Delphi extra slow compilation time

Well, there is a strange problem occured in my working project. It is written on Delphi. When I try to compile it, it takes 8 hours to compile about 770 000 lines (and it is not the end), while my colleague needs only 15-20 seconds.
I've tried everything suggested in Why does Delphi's compilation speed degrade the longer it's open, and what can I do about it?
Shorten the path to project
Defragment disc with MyDefrag
Use Clear Unit Cache (do not sure, if it worked at all)
I also turned off the optimization and I use debug mode. My PC is pretty fast (i5-2310 3.1 GHz, 16 Gb RAM, usual SATA HDDs), the bottle neck could be the HDD, but my collegue has usual one too. So, it is very mysterious, what is the reason of so slow compilation.
Edit: I apologize for lack of information. Here is additional info:
I use debug mode, release one works same.
We use Delphi XE version.
I've copied my collegue's folder with project initially.
I do not use network drive, and I tried to move project to another HDD.
Additional info about system: I use Windows 7 Enterprise N 64 bit, while my collegue uses Windows 7 32 bit, Also, Delphi XE is 32-bit (dunno, if it can be 64-bit). May be it is the reason in some way?
Edit 2: I found solution! The problem was that I installed Delphi on my Windows 64 bit system. Installing it on virtual Windows 7 x86 made it work: compiling in seconds. Dunno, why is there so big gap in perfomance.
Are you sure this is not some hardware problem, e.g. your hard disk having a bad sector? Try to put the source code on a different disk and see if the problem goes away. Or maybe the search path points to a network drive that is very slow or not even available?

System Requirement for VS 2010

I have a laptop machine with below configuration:
Core 2 Duo # 1.4 GHz
4GB RAM
320GB HardDrive
Windows 7
Whether this is sufficient for installing VS 2010? The speed of processor is 1.4GHz, but in Microsoft website they have given minimum of 1.6GHz processor speed. Can anyone tell from their experience?
Thanks in advance.
Will most likely install, however I would expect it will run slow. Depends on what sort of work you are doing. Small console apps would be OK but I doubt full blown WPF/Silverlight apps would be speedy. Also, if your connecting to a local SQL instance.. etc (could pull an increased overhead).
Sum Up.
Will install.
Work will be tedious.
Another SO post for reference VS 2010 Requirments
The main issue is the way that VS2010 uses WPF; you might find that large files behave a little jerkily in the text editor, but I don't think it'll be un-usable.
I've not tried VS2010, but I do have VS2008 + SQL Server Express installed on a netbook with a few years old Atom CPU and 2 GB of RAM, and it works fine though it's obviously a bit slow. So I'd assume that you'll have no problems since even if the requirements for VS2010 are higher, your laptop is much higher spec than that netbook.
Will work. but might have some performace issues on Editor / Designer. I had a machine with almost similar configuration. used it for silverlight developement. I always has problem in the design preview of the XAML file. - it gets loaded after some time then expected time.

Link failure with either abnormal memory consumption or LNK1106 in Visual Studio 2005

I am trying to build a solution for windows XP in Visual Studio 2005. This solution contains 81 projects (static libs, exe's, dlls) and is being successfully used by our partners. I copied the solution bundle from their repository and tried setting it up on 3 similar machines of people in our group. I was successful on two machines and the solution failed to build on my machine.
The build on my machine encountered two problems:
During a simple build creation of the biggest static library (about 522Mb in debug mode) would fail with the message "13>libd\ui1d.lib : fatal error LNK1106: invalid file or disk full: cannot seek to 0x20101879"
Full solution rebuild creates this library, however when it comes to linking the library to main .exe file, devenv.exe spawns link.exe which consumes about 80Mb of physical memory and 250MB of virtual and spawns another link.exe, which does the same. This goes on until the system runs out of memory. On PCs of my colleagues where successful build could be performed, there is only one link.exe process which uses all the memory required for linking (about 500Mb physical).
There is a plenty of hard drive space on my machine and the file system is NTFS.
All three of our systems are similar - Core2Quad processors, 4Gb of RAM, Windows XP SP3. We are using Visual studio installed from the same source.
I tried using a different RAM and CPU, using dedicated graphics adapter to eliminate possibility of video memory sharing influencing the build, putting solution files to different location, using different versions of VS 2005 (Professional, Standard and Team Suite), changing the amount of available virtual memory, running memtest86 and building the project from scratch (i.e. a clean bundle).
I have read what MSDN says about LNK1106, none of the cases apply to me except for maybe "out of heap space", however I am not sure how I should fight this.
The only idea that I have left is reinstalling the OS, however I am not sure that it would help and I am not sure that my situation wouldn't repeat itself on a different machine.
Would anyone have any sort of advice for me?
Thanks
Yes, 522 Megabytes is about as large a contiguous chunk of virtual memory that can be allocated on the 32-bit version of Windows. That's one hunking large library, you'll have to split it up.
You might be able to postpone the inevitable by building on a 64-bit version of Windows, 32-bit programs get a much larger virtual memory space, close to 4 GB.

Resources