As a .NET developer, I’ve spent most of my time coding on Windows machines. It’s only logical: Visual Studio is the richest development experience for building C# and VB.NET applications, and it only runs on Windows…right?
When I joined Stormpath to work on our open-source .NET authentication library, I was handed a MacBook Pro and given an interesting challenge: can a Mac be an awesome .NET development platform?
Under Parallels plan, click Change plan settings. On the Change settings for the plan: Parallels page, click Delete this plan. When prompted, click OK and then reinstall Parallels Tools and let us know how it works. What separated the best from the worst was primarily the number of CPUs assigned to the Parallels guest OS, and not memory or other advanced settings. After testing Parallels with memory allocations of 512 RAM, 1 GB RAM, and 2 GB RAM, along with testing with multiple CPU/Core configurations, we came to some definite conclusions.
To my surprise, the answer is yes! I’ll share how I turned a MacBook Pro into the ultimate Visual Studio development machine.
How to Run Visual Studio on a Mac
Visual Studio doesn’t run natively on OS X, so my first step was to get Windows running on my MacBook Pro. (If you want an editor that does run natively, Xamarin Studio or Visual Studio Code might fit the bill).
There are multiple options for running Windows on a Mac. Every Mac comes with Apple’s Boot Camp software, which helps you install Windows into a separate partition. To switch between OSes, you need to restart.
Parallels is a different animal: it runs Windows (or another guest OS) inside a virtual machine. This is convenient because you don’t have to restart your computer to switch over to Windows. Instead, Windows runs in an OS X application window.
I found that a combination of both worked best for me. I installed Windows into a Boot Camp partition first, and then turned that partition into an active Parallels virtual machine. This way, I have the option of using Windows in the virtual machine, or restarting to run Windows natively at full speed.
I was initially skeptical of the performance of a heavy application like Visual Studio running in a virtual machine. The option to restart to Windows via Boot Camp gave me a fallback in case Visual Studio was sluggish.
There are some minor disadvantages to this method: you can’t pause the virtual machine or save it to a snapshot. A non-Boot Camp virtual machine doesn’t have these limitations. This guide will work regardless of what type of virtual machine you create.
After three months of serious use, and some tweaks, I’ve been very impressed with Parallels’ performance. I haven’t needed to boot directly to Windows at all. (For comparison, my host machine is a 15” mid-2015 MacBook Pro with 16GB of RAM and a 1TB flash drive.)
In the remainder of this guide, I’ll detail the steps I took to optimize both Parallels and Visual Studio to run at peak performance.
Installing Windows With Boot Camp and Parallels
This part’s easy. I followed Apple’s Boot Camp guide to install Windows in a separate partition.
Then, I installed Parallels and followed the Parallels Boot Camp guide to create a new virtual machine from the existing Boot Camp partition.
Tweaking Parallels for Performance and Usability
The Parallels team publishes guidelines on how to maximize the performance of your virtual machine. Here’s what I adopted:
Virtual machine settings:
- 2 virtual CPUs
- 4096MB system memory
- 256MB graphics memory
Parallels options:
- Optimization: Faster virtual machine, Adaptive hypervisor, Tune Windows for speed all turned on.
- Sharing: Shared cloud, SmartMount, and Access Windows folders from Mac turned off, as I didn’t need these for my workflow.
I experimented with both of Parallels’ presentation modes, Coherence and Full Screen. While it was cool to see my Windows apps side-by-side with OS X in Coherence mode, I found that the UI responsiveness (especially opening and closing windows and dialogs) felt sluggish.
Because of this, I use Full Screen exclusively now. I have Windows full-screen on my external Thunderbolt display, and OS X on my laptop. If I need to use OS X on my large monitor, I can swipe the Magic Mouse to switch desktops.
Adjusting OS X and Windows Features
I fixed a few annoyances and performance drains right off the bat:
- Function keys. If you’re using the Mac keyboard, you’ll want to change the function key behavior so the F1-F12 keys work correctly in Visual Studio. From System Preferences – Keyboard, make sure Use all F1, F2, etc. keys as standard function keys is checked. With this turned on, hold Fn to use the Mac functions (brightness, volume, etc.) on F1-F12. With an external non-Mac keyboard, this isn’t an issue.
- Start menu. I’m using Windows 8, and the removal of the Start menu annoyed me. I clung to my old ways and installed Start8 to restore it.
- Disable Windows visual effects. I turned off most of the Windows desktop manager visual effects by going to Control Panel – System and Security – Advanced system settings – Advanced – Performance – Settings – Visual Effects and choosing Adjust for best performance. However, I left Smooth edges of screen fonts checked because it improves text rendering on my monitor.
Installing Visual Studio and Helpful Extensions
Installing Visual Studio is a piece of cake once the virtual machine is set up. I simply downloaded the latest release from MSDN and let the installer run.
If you use an Apple Magic Mouse (as I do), Visual Studio tends to be overly eager to zoom the text size in and out as you swipe your finger over the mouse. The Disable Mouse Wheel Zoom add-on fixes this annoyance.
Improving Visual Studio for Performance
I was impressed with how well Visual Studio performed under emulation. With a large multi-project solution open, though, I saw some slowdowns.
Through trial and error, I found a number of things that could be disabled to improve performance. You may not want to make all of the changes I did, so pick and choose your own list of tweaks:
- Disable hardware-accelerated rendering. Unchecking Automatically adjust visual experience based on client performance, Enable rich client visual experience, and Use hardware graphics acceleration if available via Options – Environment made the UI feel much more responsive on my machine.
- Start up to an empty environment. Starting up Visual Studio for the first time feels a lot snappier if you skip the default news page on startup. Select Empty environment under Options – Environment – Startup – At startup.
- Remove unused extensions. Visual Studio ships with a number of extensions that you may not need. From Tools – Extensions and Updates – Installed, remove any extensions you aren’t actively using (you can always reinstall them later). I got rid of six extensions I didn’t need.
- Disable extra debugging features. I turned off both Enable Diagnostic Tools while debugging and Show elapsed time PerfTip while debugging in Options – Debugging – General. I wasn’t using these debugging features, and debugging felt snappier after I disabled them.
- Turn off the Navigation Bar. I found the code editor Navigation Bar to be unnecessary if the Solution Explorer is open. I disabled it via Options – Text Editor – All Languages – Navigation Bar.
- Disable CodeLens. CodeLens is a cool feature for collaboration, but it’s not part of my current workflow. I got rid of the CPU overhead by turning it off via Options – Text Editor – All
Languages – CodeLens – Enable CodeLens. - Turn off Track Changes. When a file is open in the code editor, Visual Studio will represent recent changes by displaying small regions of green or yellow on the scroll bar. If you can live without this, turn off Track changes via Options – Text Editor – General for a small performance boost.
- Turn off Track Active Item. Squeeze out a little bit more UI performance out by ensuring Track Active Item in Solution Explorer is unchecked under Options – Projects and Solutions – General.
Visual Studio on a Mac: The Best of Both Worlds
With these tweaks, I’ve come to love using Visual Studio on a Mac. The performance is good, and by running Windows in a virtual machine, I get the best of both OS worlds.
Want to see what I’m building with this setup? Check out our open-source .NET SDK on Github.
Do you have any other tricks you’ve used to improve Visual Studio performance? Any must-have add-ons that boost your productivity? Leave me a comment below!
Optimizing Parallels Desktop for Mac for the best performance of a guest OS may seem to be largely a matter of customizing the performance of the guest OS itself, such as turning off visual effects in various Windows OSes. But before you start fine-tuning your Windows or other guest OS, you should first give the Parallels guest OS configuration options a tune-up. Only then can you get the best results from a guest OS.
In this guide, we're going to benchmark how well Windows 7 performs as a guest OS using Parallels Desktop 6 for Mac. We chose Windows 7 for a few reasons. It's the most current Windows OS available; it's available in both 32-bit and 64-bit versions, which makes it usable on just about all Intel Macs; and, perhaps most importantly, we just installed Windows 7 (64-bit) on Parallels to perform benchmark comparisons between Parallels, VMWare's Fusion, and Oracle's Virtual Box. With Windows 7 installed, along with our two favorite cross-platform benchmarking tools (Geekbench and CINEBENCH), we're ready to find out which settings have the most effect on guest OS performance.
16gb Ram Laptop
Performance Tuning Parallels
We're going to test the following Parallels guest OS configuration options with our benchmark tools:
- Performance Caching Options (Faster Virtual Machine or Faster Mac)
- Adaptive Hypervisor Enabled or Disabled
- Tune Windows for Speed Enabled or Disabled
- Video RAM size
- 3D Acceleration
- Guest OS RAM Size
- Number of CPU/Cores
Of the above parameters, we expect RAM size and number of CPUs to play a prominent role in guest OS performance, and Video Ram Size and 3D Acceleration to play a smaller role. We don't think the remaining options will provide a significant boost to performance, but we've been wrong before, and it's not unusual to be surprised at what performance tests reveal.
of 09
Optimize Parallels Desktop - Parallels Guest OS Optimization
of 09
Optimize Parallels Desktop - How We Test
We will use Geekbench 2.1.10 and CINEBENCH R11.5 to measure the performance of Windows 7 as we alter the guest OS configuration options.
The Benchmark Tests
Geekbench tests the processor's integer and floating-point performance, tests memory using a simple read/write performance test, and performs a stream test that measures sustained memory bandwidth. The results of the set of tests are combined to produce a single Geekbench score. We will also break out the four basic test sets (Integer Performance, Floating-Point Performance, Memory Performance, and Stream Performance), so we can see the strengths and weaknesses of each virtual environment.
CINEBENCH performs a real-world test of a computer's CPU, and its graphics card's ability to render images. The first test uses the CPU to render a photorealistic image, using CPU-intensive computations to render reflections, ambient occultation, area lighting and shading, and more. We perform the tests using a single CPU or core, and then repeat the test using multiple CPUs or cores. The result produces a reference performance grade for the computer using a single processor, a grade for all CPUs and cores, and an indication of how well multiple cores or CPUs are utilized.
The second CINEBENCH test evaluates the performance of the computer's graphics card using OpenGL to render a 3D scene while a camera moves within the scene. This test determines how fast the graphics card can perform while still accurately rendering the scene.
Testing Methodology
With seven different Guest OS configuration parameters to test, and with some parameters having multiple options, we could end up performing benchmark tests well into next year. To cut down on the number of tests to perform, and still generate meaningful results, we're going to start by testing amount of RAM and number of CPUs/Cores, since we think these variables will have the biggest impact. We will then use the worst RAM/CPU configuration and the best RAM/CPU configuration when we test the remaining performance options.
We will perform all testing after a fresh startup of both the host system and the virtual environment. Both the host and the virtual environment will have all anti-malware and antivirus applications disabled. All virtual environments will be run within a standard OS X window. In the case of the virtual environments, no user applications will be running other than the benchmarks. On the host system, with the exception of the virtual environment, no user applications will be running other than a text editor to take notes before and after testing, but never during the actual test process.
of 09
Optimize Parallels Desktop - 512 MB RAM vs. Multiple CPUs/Cores
We'll start this benchmark by assigning 512 MB of RAM to the Windows 7 guest OS. This is the minimum amount of RAM recommended by Parallels to run Windows 7 (64-bit). We thought it was a good idea to start our memory performance testing at below optimum levels, to determine how performance does or doesn't improve as memory is increased.
After setting the 512 MB RAM allotment, we ran each of our benchmarks using 1 CPU/Core. After the benchmarks were complete, we repeated the test using 2 and then 4 CPUs/Cores.
512 MB Memory Results
What we found was pretty much what we expected. Windows 7 was able to perform well, even though memory was below the recommended levels. In the Geekbench Overall, Integer, and Floating Point tests, we saw performance improve nicely as we threw additional CPUs/Cores at the tests. We saw the best scores when we made 4 CPUs/Cores available to Windows 7. The memory portion of Geekbench showed little change as CPUs/Cores were added, which is what we expected. However, the Geekbench Stream test, which measures memory bandwidth, showed a noticeable decline as we added CPUs/Cores to the mix. We saw the best Stream result with just a single CPU/core.
Our assumption is that the additional overhead of the virtual environment to use additional CPUs/Cores is what ate into the stream bandwidth performance. Even so, the improvement in the Integer and Floating Point tests with multiple CPUs/Cores is probably well worth the slight drop in Stream performance for most users.
Our CINEBENCH results also showed just about what we expected. Rendering, which uses the CPU to draw a complex image, improved as more CPUs/Cores were added to the mix. The OpenGL test uses the graphics card, so there were no noticeable changes as we added CPUs/Cores.
of 09
Optimize Parallels Desktop - 1 GB RAM vs. Multiple CPUs/Cores
We'll start this benchmark by assigning 1 GB of RAM to the Windows 7 guest OS. This is the recommended memory allocation for Windows 7 (64-bit), at least according to Parallels. We thought it was a good idea to test with this memory level, because it's likely to be the option for many users.
After setting the 1 GB RAM allotment, we ran each of our benchmarks using 1 CPU/Core. After the benchmarks were complete, we repeated the test using 2 and then 4 CPUs/Cores.
1 GB Memory Results
What we found was pretty much what we expected; Windows 7 was able to perform well, even though memory was below the recommend level. In the Geekbench Overall, Integer, and Floating Point tests, we saw performance improve nicely as we threw additional CPUs/Cores at the tests. We saw the best scores when we made 4 CPUs/Cores available to Windows 7. The memory portion of Geekbench showed little change as we added CPUs/Cores, which is what we expected. However, the Geekbench Stream test, which measures memory bandwidth, showed a noticeable decline as we added CPUs/Cores to the mix. We saw the best Stream result with just a single CPU/core.
Our assumption is that the additional overhead of the virtual environment to use additional CPUs/Cores is what ate into the stream bandwidth performance. Even so, the improvement in the Integer and Floating Point tests with multiple CPUs/Cores is probably well worth the slight drop in Stream performance for most users.
Our CINEBENCH results also showed just about what we expected. Rendering, which uses the CPU to draw a complex image, improved as more CPUs/Cores were added to the mix. The OpenGL test uses the graphics card, so there were no noticeable changes as we added CPUs/Cores.
One thing we noticed right away was that while overall performance numbers in each test were better than the 512 MB configuration, the change was marginal, hardly what we expected. Of course, the benchmark tests themselves aren't very memory-bound to begin with. We expect that real-world applications that do use memory heavily would see a boost from the added RAM.
of 09
Optimize Parallels Desktop - 2 GB RAM vs. Multiple CPUs/Cores
We'll start this benchmark by assigning 2 GB of RAM to the Windows 7 guest OS. This is likely to be the upper end of RAM allocation for most individuals who run Windows 7 (64-bit) under Parallels. We anticipate a bit better performance than the 512 MB and 1 GB tests we ran earlier.
After setting the 2 GB RAM allotment, we ran each of our benchmarks using 1 CPU/Core. After the benchmarks were complete, we repeated the tests using 2 and then 4 CPUs/Cores.
2 GB Memory Results
What we found wasn't quite what we expected. Windows 7 performed well, but we didn't expect to see such a small performance increase based on just the amount of RAM. In the Geekbench Overall, Integer, and Floating Point tests we saw performance improve nicely as we threw additional CPUs/Cores at the tests. We saw the best scores when we made 4 CPUs/Cores available to Windows 7. The memory portion of Geekbench showed little change as we added CPUs/Cores, which is what we expected. However, the Geekbench Stream test, which measures memory bandwidth, showed a noticeable decline as we added CPUs/Cores to the mix. We saw the best Stream result with just a single CPU/core.
Our assumption is that the additional overhead of the virtual environment to use additional CPUs/Cores is what ate into the stream bandwidth performance. Even so, the improvement in the Integer and Floating Point tests with multiple CPUs/Cores is probably well worth the slight drop in Stream performance for most users.
Our CINEBENCH results also showed just about what we expected. Rendering, which uses the CPU to draw a complex image, improved as more CPUs/Cores were added to the mix. The OpenGL test uses the graphics card, so there were no noticeable changes as we added CPUs/Cores.
One thing we noticed right away was that while overall performance numbers in each test were better than the 512 MB configuration, the change was marginal, hardly what we expected. Of course, the benchmark tests themselves aren't very memory-bound to begin with. We expect that real-world applications that do use memory heavily would see a boost from the added RAM.
of 09
Parallels Memory and CPU Allocation - What We Discovered
After testing Parallels with memory allocations of 512 RAM, 1 GB RAM, and 2 GB RAM, along with testing with multiple CPU/Core configurations, we came to some definite conclusions.
RAM Allocation
For the purposes of benchmark testing, the amount of RAM had little influence on overall performance. Yes, allocating more RAM did generally improve benchmark scores, but not at a substantial enough rate to warrant depriving the host OS (OS X) of RAM that it could put to better use.
Remember, though, that while we didn't see big improvements, we only tested the guest OS using benchmark tools. The actual Windows applications that you use may indeed be able to perform better with more RAM available to them. However, it's also clear that if you use your guest OS to run Outlook, Internet Explorer, or other general applications, you probably won't see any improvement by throwing more RAM at them.
CPUs/Cores
The biggest performance increase came from making additional CPUs/Cores available to the Parallels guest OS. Doubling the number of CPUs/Cores didn't produce a doubling in performance. The best performance increase came in the Integer test, with a 50% to 60% increase when we doubled the number of available CPU/Cores. We saw a 47% to 58% improvement in the Floating Point test when we doubled the CPUs/Cores.
However, because the Overall score includes memory performance, which saw little change, or in the case of Stream test, a decline as CPUs/Cores were increased, the Overall percentage improvement only ranged from 26% to 40%.
The Results
We were looking for two RAM/CPU configurations to use for the rest of our tests, the worst performing and best performing. Remember that when we say 'worst,' we're only referring to performance in the Geekbench benchmark test. The worst performance in this test is actually decent real-world performance, usable for most basic Windows applications, such as email and web browsing.
- Worst: 512 MB RAM and 1 CPU
- Best: 1 GB RAM and 4 CPUs
of 09
Parallels Video Performance - Video RAM Size
In this video performance test of Parallels, we're going to use two baseline configurations. The first will be 512 MB of RAM and a single CPU allocated to the Windows 7 guest OS. The second configuration will be 1 GB of RAM and 4 CPUs allocated to the Windows 7 guest OS. For each configuration, we'll change the amount of video memory assigned to the guest OS, to see how it effects performance.
We will use CINEBENCH R11.5 to benchmark graphics performance. CINEBENCH R11.5 runs two tests. The first is OpenGL, which measures the ability of the graphics system to accurately render an animated video. The test requires that each frame be rendered accurately, and measures the overall frame rate achieved. The OpenGL test also requires that the graphics system support hardware-based 3D acceleration. So, we'll always perform the tests with hardware acceleration enabled in Parallels.
The second test involves rendering a static image. This test uses the CPU to render a photorealistic image, using CPU-intensive computations to render reflections, ambient occultation, area lighting and shading, and more.
Expectations
We expect to see some difference in the OpenGL test as we change video RAM size, provided there is enough RAM to allow hardware acceleration to operate. Likewise, we expect the rendering test to be affected mostly by the number of CPUs available to render the photorealistic image, with little effect from the amount of video RAM.
With those assumptions in place, let's see how Parallels 6 Desktop for Mac benchmarks.
Parallels Video Performance Results
We saw little effect on the OpenGL test from changing the number of CPUs/Cores available to the guest OS. We did, however, see a slight falloff (3.2 %) in performance when we lowered the amount of video RAM from 256 MB to 128 MB.
The rendering test responded as expected to the number of CPUs/Cores available; the more the merrier. But we also saw a slight performance dip (1.7 %) when we dropped video RAM from 256 MB to 128 MB. We didn't really expect the video RAM size to have the effect it did. Even though the change was small, it was repeatable and measurable.
Parallels Video Performance Conclusion
Although the actual performance changes between video RAM sizes were marginally different, they were nevertheless measurable. And since there doesn't seem to be an outstanding reason to set video memory below the currently supported maximum size of 256 MB, it seems safe to say that the default 256 MB video RAM setting with 3D hardware acceleration enabled is indeed the best setting to use for any guest OS.
of 09
Optimize Parallels Desktop - Best Configuration for Guest OS Performance
With the benchmarks out of the way, we can turn to tuning Parallels 6 Desktop for Mac for the best performance for the guest OS.
Memory Allocation
What we found was that memory allocation had less effect on the performance of the guest OS then we first thought. What this indicates is that Parallels' built-in caching system, which is designed to aid in the base performance of the guest OS, works very well, at least for guest OSes that Parallels knows about. If you choose an unknown guest OS type, then Parallels caching may not work as well.
Therefore, when setting memory allocation for the guest OS, the key to determining the size to use is the applications you will run in the guest OS. You won't see much improvement in basic non-memory-intensive applications, such as email, browsing, and word processing, by lavishing memory on them.
Where you will see benefits from upping the memory allocation is with applications that do use a lot of RAM, such as graphics, games, complex spreadsheets, and multimedia editing.
Our recommended memory allocation then is 1 GB for most guest OSes and the basic applications they will run. Increase that amount for games and graphics, or if you're seeing subpar performance.
CPU/Cores Allocation
By far, this setting has the most effect on guest OS performance. However, as with memory allocation, if the applications you use don't need a lot of performance, you're wasting CPUs/Cores that your Mac could use if you increase the CPU/Core assignment unnecessarily. For basic applications such as email and web browsing, 1 CPU is fine. You'll see improvements in games, graphics, and multimedia with multiple cores. For these types of applications, you should assign at least 2 CPU/Cores, and more, if possible.
Video RAM Settings
This actually turned out to be pretty simple. For any Windows-based guest OS, use the maximum video RAM (256 MB), enable 3D Acceleration, and enable Vertical Synchronization.
Optimization Settings
Set the Performance setting to 'Faster virtual machine.' This will allocate physical memory from your Mac to be dedicated to the guest OS. This can improve guest OS performance, but can also reduce the performance of your Mac if you have limited memory available.
Turning the Enable Adaptive Hypervisor feature on allows the CPUs/Cores on your Mac to be assigned to whichever application is currently in focus. This means that as long as the guest OS is the foremost application, it will have a higher priority over any Mac applications you are running at the same time.
The Tune Windows for Speed option will automatically disable some Windows features that tend to slow down performance. These are mostly visual GUI elements, such as slow fading of windows and other effects.
Set Power to 'Better performance.' This will allow the guest OS to run at full speed, regardless of how that will affect the battery in a portable Mac.
of 09
Optimize Parallels Desktop - Best Configuration for Mac Performance
Tuning Parallels' guest OS configuration options for best Mac performance assumes that you have guest OS applications that you wish to leave running at all times, and that you want them to have minimal impact on your use of your Mac. An example would be running Outlook in the guest OS, so you can frequently check your corporate email. You want your Mac applications to continue to run, without any big performance hit from running the virtual machine.
Page File Size For 16gb Ram
Memory Allocation
Set the guest OS to the minimum memory required for the OS plus the applications you wish to run. For basic Windows applications, such as email and browsers, 512 MB should be sufficient. This will leave more RAM for your Mac applications.
CPUs/Cores Allocation
Because guest OS performance isn't the goal here, setting the guest OS to have access to a single CPU/Core should be adequate to ensure that the guest OS can operate well, and that your Mac isn't unduly burdened.
Video RAM Allocation
Video RAM and its related setting actually have little impact on your Mac's performance. We suggest leaving it at the default setting for the guest OS.
Optimization Settings
Set the Performance setting to 'Faster Mac OS.' This will give preference to allocating physical memory to your Mac instead of dedicating it to the guest OS, and improve your Mac's performance. The downside is that the guest OS could be short on available memory, and perform slowly until your Mac makes memory available to it.
Turn the Enable Adaptive Hypervisor feature on to allow the CPUs/Cores on your Mac to be assigned to whichever application is currently in focus. This means that as long as the guest OS is in the background, it will have a lower priority than any Mac application you're running at the same time. When you switch focus to the guest OS, you will see an increase in performance while you're working with it.
The Tune Windows for Speed feature will automatically disable some Windows features that tend to slow down performance. These are mostly visual GUI elements, such as slow fading of windows and other effects. Overall, the Tune Windows for Speed settings won't have much effect on your Mac's performance, but should give the guest OS a nice boost when you're actively working with it.
Set Power to 'Longer Battery Life' to reduce the performance of the guest OS and extend the battery in a portable Mac. If you're not using a portable Mac, this setting won't really make much difference.