4 ms·
Unless you can leverage special instructions / hw to realize your array operations, loops will be the fundamental operations generated by the compiler executed
by kbbr 7y ago
Unless you can leverage special instructions / hw to realize your array operations, loops will be the fundamental operations generated by the compiler executed by the CPU.
For a lot of scenarios, loopless code is surely more expressive. However, I would not say that it is per se in any kind superior. Rather, it is a feature of each language, how much to abstract from the actual CPU instructions.
So to have fine granular control over your generated code, classic loops in C always relevant, while a simple array operation can be expressed in such high level way for other use cases.