Install second operating system on internal (as VM with Parallels) or external drive? I am using an old MacBook and I want to keep my operating system. For coding with Xcode I would need a newer version of OS X.

My question is, if the performance is better when I:


Install the new operating system on internal HDD via Parallels.
Install it on an extern HDD and boot the laptop from there.


I just want to code in Xcode so the only thing that matters to me is performance.
A native OS is always faster than one running in a virtual machine. 

That would seem to be obvious, so edit your Question if I am misunderstanding you, or if you had other issues or complications in mind. If your external drive or connection is slow, then booting to external might be about the same as the VM on internal drive, or even worse if using a USB 2 drive/connection. On a Thunderbolt drive, you will be running faster than than will the VM on internal.

On the other hand, I have successfully done Xcode programming in a VM in Parallels. The performance is surprisingly good. 

There are always niggly glitches and bugs in Parallels, and always changing version to version as some get fixed while new ones appear. But I've encountered no showstoppers, just annoyances. The most serious bug suffered by me and reported by others is that the mouse suddenly and inexplicably becomes useless within the VM. The workaround is to suspend and restore the VM. Takes about 10-20 seconds, and solves the problem reliably, but is quite annoying. 

Currently, there are still issues with trying to run the VM in Retina mode. While it generally works well enough, it really slows down performance noticeably. And a few apps malfunction, misinterpreting the resolution, causing the content of their windows to be dramatically zoomed in, rendering the app unusable. In addition to some web browsers, this happens in the Xcode Simulator. Workaround is to shutoff Retina mode in your VM’s settings. 

Another benefit of a VM is keeping Apple's confusing array of settings and security certificates in Keychain all stored nicely in the VM and kept separate from your own stuff on your real Mac. If doing a clean install or moving to a fresh Mac, would you know how to move all the pieces needed to keep Xcode and iTunesConnect happy?