The FFmpeg project is certainly unknown to many people, but its features are simply outstanding when it comes to audio and video encoding and decoding. So much so that all major technology companies, from YouTube to Netflix to Spotify, use it.
Assembler. What’s interesting is that these days someone discovered something surprising: FFmpeg can run up to 94 times faster, and all of this is possible thanks to the use of assembler, a low-level programming language that provides much more direct access to PC resources than other computer resources. High-level languages and compilers that produce executable code do this. DeepMind recently used this to create a revolutionary sorting algorithm, which also formed the basis of Voyager 1 programming.
let’s try. A group of developers contributing to the project wanted to test the implementation of certain functions using the AVX-512 instruction set. The advantage of these instructions is that they allow larger data arrays to be processed in parallel using 512-bit registers; This is something that is very useful for all types of tasks, especially processing audio and video.
Up to 94x faster. Performance tests showed that functions written in assembly with the AVX-512 instruction set executed much faster than traditional implementations written in the C programming language or instruction sets such as AVX2 (Advanced Vector Extensions, in this case processing 256 bits) and the older SSE3. (Stream SIMD Extension 3) From 2004. In some cases, the new code ran 94 times faster than the other. versions.
It will be difficult to take advantage of these developments. Unfortunately, these improvements are unlikely to be widely used. Intel disabled AVX-512 in its chips because high-efficiency cores did not support it; but there are ways to take advantage of this by disabling these E cores.
Yes, they are powered by AMD chips, but the real problem lies elsewhere: the complexity of these optimizations is reserved for very specific applications. But Big Tech may have taken note of these advantages and leveraged them to process audio and video in data centers.
A secret but extraordinary language. The truth is that assembly language is not very popular for good reason. It’s a very complex language, it’s different for every machine/architecture and it’s easy to make mistakes. High-level languages, compilers, and programming environments have made these tasks much more accessible, but logically they have done so at the expense of potential inefficiencies. What’s happening with FFmpeg proves this: there are projects that would likely gain notable benefits by leveraging the power of assembly code, and they do so because, as they point out on the r/asm subreddit, every byte counts in the assembler.
in Xataka | Legendary programming language COBOL turns 60 and will probably stay 60 years old