D
dbtid
On very long strings yes. Why? because there is no comparison blocking
every substitution/transfer. Clearly the strcpy will be faster.
Wasn't that the point of all the attacks? That it *wouldn't* be faster?
If that wasn't the point, why did you EVER open your mouth (figuratively
speaking)?
If the test isn't good enough for you, why don't you make a comparison in
which 50% of the bytes are '.' and see what happens? Or why not do it for
0%-100% and then post your results? That way you can be sure no one's
being fooled.
The number of "." will be a big input as well.
ITYM '.', not ".". Any proficient C programmer would know this.
Amen.
Amen.
There are other lessons to learn:
1) Anyone can engineer any results when they feel the need. 2 meg
strings? for a 4% increase? No mention of the data involved? Come off it.
Well, he said it was random. How is that an attempt to engineer results?
2) The code above is not to do with pure speed at runtime
The code above is not "terse". It is bog standard C. Sorry.
Why does the code have to be terse? I'm not sure what "bog standard C"
is. I've looked, and I can't find any IEC/ISO "bog standard" versions of
C. (If you don't see the humour in that, you need more help than just in
learning C and how to communicate on Usenet.)
It is most certainly not "bad code" - it is a damn site easier to look
at and maintain than RHs in my humber opinion.
How is it easier? Because there's less of it? I'm guessing you've never
read any of the IOCCC entries.
And, would you *PLEASE* get a spell checker, or a dictionary, or a 10
year-old to check your spelling and grammar??
And as for your "humble opinion" (correction mine), you are, from what
I've observed, a far cry from humble.
You show absolutely no humility at all in any of your postings. FYI, a
critical spirit is NOT a humble spirit. For some reason, you've got an
axe to grind.
Almost all of your postings on this topic that I've read are critical of
Heathfield for the sake of being critical.
2 lines of core code beats 15 any day of the week when the functionality
is so trivial. And it IS trivial. AND we are not taling 2k long lines
here either. Basic pointer dereference and assignments.
As a generic comment, that's pure bullshit. You could write several loops
on two lines, which could easily be made "trivial," and they'd be a damn
sight more difficult to read than those same loops put on different lines.
You would do the people/computers/aliens who read c.l.c a great service if
you would find something more worthwhile to do with your time than make
all these ridiculous assertions.
Several things come to mind, but you'd probably take offense, so I won't
post them here.