Nested Page Tables.
Normally, the OS swaps page tables when it “context switches” between processes as it multitasks, sometimes it needs to do this just to answer a syscall or use a driver to talk to hardware.
The tables map virtual memory addresses grouped into pages of memory as seen by a process, to physical memory addresses.
Without NPT, When running a virtualized OS, virtualized OS can’t be allowed to do that, because it can’t be allowed access to all of memory, so in order to keep things working safely, when guest OS tries to do it, that generates an exception / protection fault / … trying to do one of these things, host OS needs to catch that and do it on behalf of the virtualized OS, in a safe manner, pretending like that operation succeeded.
NPT allows the host OS to assign a set of pages for the guest OS in advance as pages that are owned by this guest, and allow the guest OS to work within this set of pages, without having to go through the fault / interrupt / exception/ … mechanism every time the guest needs to context switch from one process to another.
It’s similar to how a process on a system normally doesn’t have direct access to all of memory directly, but ends up running in some virtual address space that maps to physical memory via page tables. It’s “nested” because it’s just one more level of that.
This sucks more for “compiling” in the guest because there’s lots of processes created all the time which creates memory spaces which is targeting the expensive path of the guest/host interaction.
It sucks, but sucks a bit less for gaming, because usually you’d run your game and only a couple of idle other things in the guest os.
But, you may notice it more during gaming cause it’s interactive, whereas usually when compiling, you press enter, you take a sip of coffee, or take a walk around the apartment or an office, and it may or may not be done by the time you’re back.
edited: cause I suck at explaining apparently and tend to presume lot of prior knowledge.