by nly · 12y ago · 0 comments
Regarding context switches: A full CPU context switch on x86 (not to ring1 but between two arbitrary points within a single userland address space) takes a few dozen instructions and about 40-80 cycles. A single cache-line miss resulting in a load from main memory on the other hand takes at least twice that (~200 cycles). Again, hits from jumping around in memory will dominate.
How significant is a 20% overhead from virtual memory? Probably about the same as getting 1% more of your memory accesses back in to high level caches.
So as long as we are talking about interprocess communication there will be a gain, but not for the actual hardware facing operation.
Then again, you are trading a hardware enforced isolation which is simple and proven for a isolation enforced by a complex and fragile VM.