Make Your QEMU 10 Times Faster: A Weird Trick

2024-12-17

While debugging NixOS tests, Linus Heckemann discovered painfully slow data copying times (over 2 hours) in a QEMU virtual machine. Performance analysis with `perf` revealed that QEMU's 9p server used an inefficient linked list (O(n) complexity) for file lookups. By switching to a hash table provided by glib (O(1) complexity), he reduced the test time to 7 minutes and successfully contributed the optimization to the QEMU project.

Development 9p protocol