FreeBSD vs Linux: Battle Settled with One Line of Code

Speed of FreeBSD Download Increased by 100 Times

Replacing the sorting algorithm in the FreeBSD core allowed to increase the speed of its download by 100 times or even more. Although this change was initially directed to micro-vm, all users will benefit from it.

In the past five years, micro-VM has gained significant prominence in the technological field. The concept involves creating an operating system designed to function as a guest system for another OS. This allows the guest OS to require minimal support for real equipment and communicate directly with the resources provided by the Host Hypervisor, resulting in a more streamlined and compact hypervisor.

This approach not only reduces the requirements of the hypervisor but also the operating system running within it. As a result, it allows for the utilization of fewer resources and significantly reduces the start time of virtual machines.

The primary commercial objective of this approach is to provide users with “free-hearted” computing power, where they can work without having to comprehend the underlying infrastructure. AWS offers a similar model through its Lambda service, which operates on the Firecracker hypervisor developed by Amazon.

Colin Persival, a FreeBSD kernel developer, made the decision to implement FreeBSD on Firecracker. According to Persival, the recent performance upgrade has been remarkable: by replacing the sorting algorithm, the loading process of the FreeBSD kernel has been accelerated a hundredfold, reducing the loading time to a mere 25 milliseconds.

After a series of subsequent optimizations, Persival stated, “Linux loads in 75-80 ms in the same environment where my FreeBSD loads in 25 ms.” He also mentioned that the kernel, which previously took 10 seconds to load, now loads about 400 times faster.

Currently, the optimized kernel is based on FreeBSD 14 on X86-64. However, efforts are being made to adapt it for ARM64, considering that AWS is the largest user of ARM-based servers in the world.

/Reports, release notes, official announcements.