const main args?

Jonathan M Davis jmdavisProg at gmx.com
Sat Aug 13 10:08:52 PDT 2011


On Saturday, August 13, 2011 15:03:56 Andrej Mitrovic wrote:
> I don't recall the last time `void main()` was a bottleneck in my apps. :p
> Maybe it would actually make a big difference in CGI apps though.

I doubt that it will _ever_ make a difference performance-wise. It's obviously 
not in a loop, and with an application that you're running over and over 
again, the start up time for the runtime will outweigh any individual 
popFront.

However, every bit of efficiency does count. So, if it's just as easy to do one 
thing as another, and one is more efficient, then generally speaking, it's 
better to pick the efficent one. And honestly, since popping the front off of an 
array is more verbose than slicing it, if you're only going to be operating on 
the array once, then slicing it is better IMHO.

Regardless, it's not a big deal in this case.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list