Experiment pentru creșterea eficienței utilitarului cat

Ariadne Conill, creator of the Audacious music player, initiator of the IRCv3 protocol development, and leader of the Alpine Linux security team, conducted a study on how to optimize the cat utility, which outputs one or more files to the standard output stream. Two optimization options have been proposed for improving the performance of cat in Linux, based on the use of the system calls sendfile and splice for directly copying data between file descriptors at the kernel level without switching context to user space.

The basic implementation, using traditional read and write calls that lead to context switching, showed a performance of 3.6 GB/s when copying a 4GB file from tmpfs. The sendfile-based option raised performance to 6.4 GB/s, while the splice-based option achieved 11.6 GB/s, making it over three times faster than the original variant.

Sursa: opennet.ro

Cumpără un hosting fiabil pentru site-uri cu protecție DDoS, servere VPS VDS 🔥 Cumpără un hosting fiabil pentru site-uri cu protecție DDoS, servere VPS VDS | ProHoster