4 ms·
There are a lot of tricks to modern architectures and things that modern compilers can figure out. There's more to making things fast than using the right inst
by wheels 18y ago
There are a lot of tricks to modern architectures and things that modern compilers can figure out. There's more to making things fast than using the right instructions -- modern optimizers also try to keep the CPU pipelines full, unroll loops where appropriate, try to detect operations that don't do anything, etc.
Note that I'm not so much comparing against Python as comparing to calling a C function from Python (which is easy).
The cases where you tend to want to do things in assembly are usually where there are assumptions that you can make about the execution that the compiler can't know.