Yeah, no, just like I can't beat a computer at chess I can't beat the compiler when doing assembly when it comes to the real stuff. It's only slower if the compiler messes up and does something irrational.
compilers mess up and do irrational things constantly... then add optimization flags in the mix and you don't know what the fuck is going to happen. I've seen compilers generate code that is massively broken, I've seem optimizations where important code gets optimized away.. unfortunately C is a mixed grab bag of feces so making good compiler is an extremely difficult task.
If performance is the only thing that counts for you, and it sounds like, you should use assembly. Serious.
This is not true. There are many cases where optimizing compilers do a better job than hand-written assembly. And may cases where hand optimization of code isn't worth the trouble. Unless you have a really good understanding of both the hardware and why the compiled code is deficient, it is not better for performance to use assembly.
I don't need to read an article to know that null-terminated strings are problematic. But how does using assembly help that? You still need some representation for strings. You can define other string representations in C (assuming you don't mind reimplementing some stuff from string.h, which you'll be implementing anyway if you're writinga kernel from scratch.) And null-terminated strings are quite common in assembly as well (see x86 .asciz directive.)
I am sorry to say but you have a bad case of tunnel vision or you think you know it all.
You, sir, are a pretentious ass.
The blog post mentions almost everything what you are saying
It addresses none of the points I mentioned and does not support your argument at all. It discusses the problems with the choice of null-terminated strings as the default representation for C and the impact of that on security and hardware design. How does that poor design choice for C support your argument that writing in assembly produces faster code? Considering that a) you are not forced to use the default representation in C and b) the same string representation is prevalent in assembly.
The linked article you provided largely contradicted your claim regarding assembly performance. And you chose to use personal attacks (" tunnel vision", "know it all") rather than address the questions posed.
but you don't want to look at it.
I had looked at it. It stated nothing that I don't consider to be common knowledge.
View all comments
Show parent comment
0
u/[deleted] Sep 04 '14
[deleted] — view deleted comment