If you had a million hits in one day... 1,000,000 / 24 =~ 41,666 per hour / 60 =~ 694 per minute = 11.5 per second. In my machine both of the options perform at over 6000 operations per second. In order for CGI to become my bottleneck then i would need 518,400,000 hits per day!!!! Yes this assumes a uniform distribution, but the numbers...look at them!! And this is on a PC not a web server and a single one, not a load balanced situation that you should have if you are approaching these kinds of hits. Is yours faster? Yes certainly, but CGI is a well worn tool, it will do what you need now, and down the road it will step up and do things you didn't even know you needed, not bite you in the arse like a hand built solution may.
Use what you want but don't make statments like 12471% more efficient like that is a reason to squeeze this particular piece of code.
| [reply] |
Your example is true if all you're doing is printing headers, and if you're on a dedicated server, and if you're not running a database server. The way I'm arranging this site, there will be one script that will probably be run at least 100 times more than any other. I'd rather be cautious and not get kicked off my host for using too many resources.
Since know one seems to know of any situation where hand-crafted headers might be a problem, I'll just do that and I can switch to CGI later if I need to. The more complicated and less popular scripts can still use CGI.
| [reply] |
Yes my numbers are only true in that case but it is all relative. The point wasn't the number, they where the wow, the point was that both take an exceptionaly small amount of time, so don't base any judgments on a benchmark figure that is "relativly" worthless. Sorry if i missed that point before.
| [reply] |