Just goes to show that when you work on a project that's so fundamentally useful that it doesn't require constant pivoting, you can not only address all your tech debt, but actually get around to those optimizations you brainstormed.
post
AVX512, SIMD
It's not just "handwritten assembly", it's all intrinsics, again. The reason a lot of tech that needs to use fast matrix algebra (or fast numeric math in general) tries to use the same small set of libraries, tightly optimized to use those optimized instruction sets.
I wish they made a 100x leap to the AV1 encoder. Even on my 12900k it runs at like 0.001x real time, which is... well, unusably slow.
Are you using 'libaom-av1' or 'libsvtav1'? Libaom-av1 is very known for being very slow.
What does 'handwritten assembly code' mean? I assume they're not writing it in cursive. Apparently some code is compiler created so it sounds like this is a synonym for code written by a person? There must be a better term for describing this than 'handwritten'.
It means someone wrote actual assembly code instead of writing C code and relying on the compiler to generare optimal assembly for them.
Yes, I believe you understand correctly. The vast majority of all native code is written by other computer programs (compilers). Handwritten assembly code usually means code that was instead produced more directly by a human programmer, most probably with the help of an assembler rather than compiling from a higher-level language.
As a more concrete example for people out there. C is an example of a "high level" programming language. In C you might write a statement like "int x = 3;".
"Assembly language" is a "human readable" representation of the instructions that are actually executed by your CPUs*. There is a different assembly language for each processor or processor family. Your desktop or laptop computer with an Intel or AMD chip, and in all likelihood execute the "x86_64" language. Meanwhile, your phone is probably on the "AArch64" language. An example of assembly language is "mov rax, #3", which loads register rax with the value 3. Notice that we have dispensed with the niceties of variable names.
Assembly language is "assembled" into the "machine language.". To do this, the "human readable" mnemonics like "mov" are replaced with numbers called opcodes. The sequence of opcodes and arguments, like the number 3, are called the "machine code", because the CPU silicon can read those numbers from memory and follow the instructions with no additional translation steps*.
*Microcode throws a wrench here. Folks like Intel realized they could run things more efficiently if they translated each machine language instruction into simpler microcode instructions onboard the chip.
Here's an example of inline assembly in C++. You can write assembly inside your higher level code for performance optimizations to just doing really specific things that you can only really do at an assembly level. I've never done it before but it definitely is cool when people do it.
Assembly pff...
The future is vibe coding! If it had been made with Claudepilot with the right types-question guy, it would be 10,000,000 times speedier.
This is such a missleading claim. You cannot get a 100x speed up with handwritten assembly unless the code before what utter shit to start with. Assembly is not the cause for the 100x speedup here, the fact that it was written to use SIMD instructions are the bigger reason for the speedup. You don't require asm to make use of SIMD instructions.
Maybe using the SIMD instructions, coupled with using Assembly, got the speedup to 100x?
Even if true, SIMD is doing the heavy lifting here. Probably followed by the fact that almost any rewrite of a code base will result in performance improvements due to the nature of being more familiar with the domain and where the bottle necks are. I would be surprised if the assembly was responsible for more then about 1% of the gains here. So why highlight the fact assembly was used here? It is just missleading. If you want to show how ASM is so much better you need a much better example then this. For all we know the use of ASM could have made things slower and harder to develop. There is just no details at all as to why ASM is beneficial here except some author seems to love it.
all 18 comments