You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The way we used dispatch queue was not optimal, leading to creation of
too many threads, which can cause unneeded context switching, and lower
performance.
We use now 2 queues:
- vms_queue - concurrent queue use to run accepted connections
threads. For this queue we must use concurrent queue since we want to
process requests from VMs in parallel.
- host_queue - serial queue for processing events from vmnet. This queue
is used for the start and stop callback and for the events callback.
With this change we use consistent number of threads: main thread, 1
vmnet thread, 1 thread per connected vm.
Testing show no change in performance.
| hardware | os | test | before (Gb/s) | after (Gb/s) |
|----------|--------|---------------|---------------|--------------|
| M1 Pro | 14.7.1 | host-to-vm | 3.252 | 3.219 |
| M1 Pro | 14.7.1 | host-to-vm-2 | 1.902 | 1.880 |
| M1 Pro | 14.7.1 | vm-to-vm | 1.493 | 1.507 |
| M2 Max | 15.1 | host-to-vm | 2.335 | 2.359 |
| M2 Max | 15.1 | host-to-vm-2 | 1.798 | 1.802 |
| M2 Max | 15.1 | vm-to-vm | 1.275 | 1.266 |
Results are average send throughput of 10 runs. Using performance tests
from #66.
We have a performance regression on macOS 15.1. With 14.7 on same M2 Max
machine it was up ot 1.2 times faster. With 15.1 it is up to 1.4 times
slower.
Signed-off-by: Nir Soffer <[email protected]>
0 commit comments