Timwi-
Oh, *that* kind of profiling. I have done that with C++ applications under Windows, but I never thought it'd be necessary for webserver applications... Clearly, at least our *current* problem - and also the current problem of LiveJournal (sorry I keep mentioning LiveJournal, but it's the first and only other major website I've major contributed at) - is database performance, not CPU usage.
Python has a profiling module. See an example which i used to find bottlenecks in the bittorrent code: http://24.175.39.66/~hperes/btdh_upload_only_XP1800_20minutes_runtime.txt
Well, that's not necessarily true. CPU usage on Larousse (the webserver for En:) has been very high, and our page parser is very ugly and slow. Clearly we need optimizations on both fronts.
Python has an amazing JIT/code optimizer named psyco (psyco.sf.net). Most text processing type operations are sped up to the level of pure C. I wrote a difflib module (almost identitical to our difflib.php here) in C/python api and psyco (when run on the pure python version) met it's performance.
The "reduced performance" argument is something I don't know anything about; it is possible that this is a good argument, but I'm not convinced.
Well, then test it. Throw some 10 megabyte files into the database and compare the reading performance with multiple threads to direct Apache server access.
YES. test,test,test. This is the precept of extreme (and proper) programming.
Perl-OOP is a bit ugly, but reasonably powerful. Check out perldoc perltoot for details. You'll want to look at "tie" especially, as this allows you to do some cool stuff with properties.
Mainly its just ugly. Perl is a horrible language whose time has passed. Its number one bad feature is confusion. Perl allows more unmaintainable and entropic code than most any language except brainfuck. It's development is pathetic over the last few years, the language and community have no focus.
Python is a language that is only 1 year younger than perl (1990). Its had threads since the beginning, whereas perl just obtained them last year for example... Python has no bad features, in that it only allows for low entropy code. It has a rich standard library, and is accepted widely. Read this oreilley publication http://www.onlamp.com/pub/wlg/3198 which covers 8 stories in big industry (industrial-light-and-magic ILM for example) and how after years of working with things python is the number 1 language of choice over php, perl, c, java, lisp.
There is a great wiki written in python, called moin moin, its filed based even, not database based, and i believe that this avenue is more lightweight and deserves some consideration. Yes...ive followed all wikipedia's static-file "to cache or not to cache arguments...".
There are great idioms and frameworks out there to make content management and web publishing low-entropy and maximally effective.
Namely: zope's cmf: http://cmf.zope.org/ AND twisted.woven: http://twistedmatrix.com/documents/howto/woven and of course...mod_python which is in-apache.
Heck...this wikitech mailing list (list.org) is written in python.
google, yahoo , various goverments accross the world all prefer python. Dynamically typed langauages like perl, python, and php are far more productive than anally typed java/ocaml. And archaic langauges like c++, c, fortan.
__________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com