Since we've decided exit() doesn't matter, how slow are variable arguments?
Printable View
Since we've decided exit() doesn't matter, how slow are variable arguments?
These "how slow is foo" questions are quite silly. It will depend on the compiler, the platform, what you're doing with them, etc.
If you're curious, why don't you do some benchmarking on it yourself? Personally, I don't see the point. Even if we take the simple case of printf, is the bottleneck of the function the act of parsing the format specifier, the overhead of doing I/O to a stream, or the fact that it has variable arguments. I'd expect not the latter. Implementation-wise, variable arguments are just parameters pushed onto the stack, like any other function. The speed the function executes will depend on the processing done, rather than the fact that it's a variable number.
Okay, I'll stop asking "How slow is foo?". Just wondering.
Sorry, calling it silly was perhaps a little harsh.
That's okay.
Dunno, but posting vague questions seems pretty quick :rolleyes: