Leigh wrote:
Unlike you I value other people experience, and choices.
next line:
If you don't want to use OO, I don't care.
seems sort of oxymoronical that you value experience, yet don't care about mine.
yes i have designed portal systems and currently only code for sites that get millions of hits a day. yes i fully understand the entire slashdot server and code setup, and have read up on countless other high load configurations such as anandtech and hotornot type sites. my hard disks are all under 3ms seek with minimum SCSI ultra160. i only use gigabit. every server in my farm of 30 4u rackmounts is at least dual 1.2 athon MPs with 1GB pc2100 ddr registered ecc ram. for main servers i use sun E450 quad processor machines. hopefully by now you realize that i DO value that millisecond. now that your hardware issue has been answered, i'll move to all your software comments.
for many applications suck as photo rendering and other server intensive applications i DO write in C and notice significant speed increases. going to machine code or fortran for such things as manipulating jpegs would be extremely difficult and not worth the development and code maintanence time required. thus the cost/reward ratio is too high, so i stopped at C.
i would LOVE to see the benchmarks that JSP is faster than PHP. i have benchmarked it with identical code on my own and PHP was much faster.... also ZDNet did some. here are their results if you don't believe me (and by now i'm not sure you believe anyone):
PHP pumped out about 47 pages/second
Microsoft ASP pumped out about 43 pages/second
Allaire ColdFusion pumped out about 29 pages/second
Sun Java JSP pumped out about 13 pages/second
JSP is fastest?! this was not an idividul betchmark, this was a wide array of tests. proving that PHP is the most versatile server side scripting solution. you might have seen a JSP provided benchmark of something it does well. <humor>maybe a sucking benchmark?</humor>
so i use php, again, because of cost/reward. very easy to install... very easy to manage... very easy to code... very easy to update.
php is interpreted, yes... but you can use compilation caching tools such as zend accelerator. basically the result is compiled code updated whenever the file is updated. i personally get about 3x more performance using this, and achieve near static page serving speed. the OO benchmarks say that it is about 3x slower than straight interpreted php. (so my code runs 9x faster than OO everything else aside)
my point: COST / REWARD is all that matters.
new hardware... relatively low cost, relatively HUGE reward. do it.
apache... free / best. use it.
php... free / best. use it.
php accelerator... low / 3x performance. buy it.
C code in certain places... if cost of instantiating the C program is more than if you were already using a php script anyways and just did it in there, then there is no reward. if the reward is small, the cost is relative complexity, don't do it. if the reward is high, do it.
now on to your case specifically:
you are using OO, when you could just be using different scripts as modules and treat it like a class, but not use OO. the cost of OO code is high (3x performance loss) the reward is simplified code. if simplified code is highly required, then do it, but only if you can't do the same thing and maintain code simplicity without using OO.
problems if you COULD have maintained code simplicity without OO, but refuse to switch:
1) you'll get to a point where you peak out the server... you could use the same server and serve 9x as many pages if you had gone non OO with zend accelerator. this doesn't matter if this is just for you, but if you release it, people would rather change software than servers (for the same cost/reward reasons above)
2) someone will take your product, FIX IT, and then release it and you wont be the maintainer anymore and your ego wouldn't like that. (plus people from step one will switch to step 2 software)
3) thus, no one will use your product, and all your work will be in vain. thats fine if you don't care, or are building it for yourself.
slashdot uses perl... perl is slower. when asked why he uses it, his response was 'yeah, i know, but perl is cooler'. i'm assuming you just think OO is cooler, and thus any amount of reason will anger you similar to the slashcode authors. if you just WANT to use it, then use it, and jack off to your code if you want... i don't care. if you want an honest suggestion on a project i am assuming you are going to distribute and advertise as portal software (= high load), stay away from OO for simple tasks and data management. stay away from OO for simple tasks and data management. stay away from OO for simple tasks and data management. your real goal should be caching as much stuff as posible. use a mixture of DHTML, javascript, cookies, PHP to even further minimize server load. all i have done for the last few weeks is optimize perfectly fine corporate intranet software (the ultimate portal)... and that is what i am doing. if caching odd data in cookies, and using javascript and DHTML to generate the page rather than a single database query, and it can be done faster, then i do it. and no, it could not be done faster in C at that point.
for(;😉 echo "stay away from OO for simple tasks and data management";