Re: Swaping?
On 2008-01-12 23:49, Toms h0ilidhe wrote:
=?UTF-8?B?RXJpayBXaWtzdHLDtm0=?=:
There is nothing wrong with
optimisation, just premature optimisation.
I argue that there's no such thing as premature optimisation. While I'm
writing code, I'll think there and then "hmmm maybe I should do it this way
it'd be pretty fast".
And that piece of code will now be one hundred of a second faster and
will run once every hour, who will notice? Was the increased maintenance
cost worth it? Of course there are premature optimisation, if you work
in the industry for some time you are bound to come across it.
Exactly do you mean with Windows in this case? And further more,
what investigations have you made that tells you that they are using
the stack more than they have to. We still would like some kind of
evidence.
If you use std::string's where you could have used char arrays on the
stack, then the code will be slower. Most times, the difference in speed
will not be noticable. However there was one time I wrote an algorithm to
convert "8732" to "Eight thousand, seven hundred and thirty-two" in three
different languages. I ran it against a database of fifty-hundred different
numbers, and the char array form was a hell of a lot faster than the
std::string form.
And what does that have to do with Windows code?
--
Erik Wikstr?m