E
Ertugrul Söylemez
Richard said:Ertugrul Söylemez said:jacob navia said:You are completely WRONG.
You could use some improvement in your reasoning. =)
A small program has many advantages:
[a lot of irrelevant crap]
I'm not coding like a pig. Cleaning up properly is not bloat, and
that's all I'm talking about.
However, even if I were talking about bloat, your reasoning is still
nonsense. You're programming in C after all. To get maximum speed,
you need to program in Assembler.
No you dont. More often than not a modern compiler will pick better
instruction sequences than you will. Sure you might revert to
assembler in some corner cases where it makes sense and you know
certain tricks or have certain needs that compiler can not be hinted
at.
Programming in C means giving up performance. Yes, of course the
compiler will optimize better than you, but to get the _best_ code there
is only one option: Assembler. In fact to get the fastest executable
file, even assembler won't be enough. The linker may choose nonoptimal
arrangements and make the file unnecessarily big.
Of course the differences are neglible, but Jacob seems to care about
them. And if he says that he doesn't care about them, he implicitly
admits that he might have got his priorities wrong.
In one instance yes. Not in millions of iterations. Are you a student?
No, I'm not a student, but I prefer correct code. In no realistic
scenario will freeing memory make a noticable difference. I have
benchmarked it. Allocating _and_ freeing five million (!) blocks of 256
bytes take 1.6 seconds on my system. No inner loop allocates five
million blocks of memory with each iteration.
Greets
Ertugrul