3 ms·
> It's pretty well agreed at this point that a good C compiler will generate faster code than someone writing assembly. We must be discussing with different pe
by gens 10y ago
> It's pretty well agreed at this point that a good C compiler will generate faster code than someone writing assembly.
We must be discussing with different people then. Have you ever looked at what a compiler spits out ? My rule is that a compiler is as good as a half-decent assembly coder. I won't even go into the limitations of compilers.
> It's of course possible to write code that's at least as fast in assembly, but in practice, nobody would do it, because the program would be unmaintainable.
You don't write the whole program in assembly. But you can write it with it still being maintainable if you use just a little constraint and forward planing. See the Fresh IDE and libraries that go with it [0].
If you want to write performant C, you should focus on writing simple code. Being smart, especially with needless abstractions, will more often then not result in slower programs. The "hello i am a compiler" crap was never true and won't be in the near future.
[0] https://fresh.flatassembler.net/ https://fresh.flatassembler.net/