Carl Banks wrote: > G. Monzón wrote: > > Please don't compare PHP with Python... They are very different worlds. > > I'm not. I was simply agreeing that the single executable way the OP > claimed PHP does it can *sometimes* be preferrable in Python, and > giving him recommendations thereto. > > Carl Banks
Sorry Carl, my reply was for the OP. I pressed the wrong reply button... doesn't meant you did any comparation! I said that about comparing, as the OP thought Python coded in Python approach for a lot of core libraries isn't as efficient as in PHP 'cause they are all coded in C. And that's not true. Yes, it could be obvious for some people that it "should" run faster than Python, having all core functions coded in C, yes, but in overall performance matters, that's not true in any case. Python has all the primitives C coded as said in this thread. PHP "primitives" are no more than hash-tables and lots zvals... far away from the hi-tuned advanced data-types Python exposes. That makes a big performance improvement over PHP, regards C or Python coded core functions -let language implementation details apart-. Major loss of performance in Python and PHP is on translating data values to C side and all the functions calling done for as little as a value assignment to a variable. So, sometimes, to code a function in C or let it be Python, makes no more than a 1us per call difference... I'd like to see this value compared to PHP. That's why PHP need a C implementation for all core functions, as if they would be PHP coded, performance would be even a lot worse. And I would't say PHP is slow. But It depends on what you need to do. 'Cause PHP can be really slow and ultra-high memory consuming. While you had this troubles with PHP, is nice to see how Python performs: consumes a lot less of memory and goes 50 % more fast. About a single executable file, I thought PHP is being distributed in windows and linux as an executable plus an dinamic link library, that's the minimum thing you need to run scripts. So OP is wrong, there is not a single executable file. You need two files at least + php.ini + extensions to run almost any PHP script. And a PHP or Python without extensions or batteries, wouldn't be very handy... oh well, that depends on the task to do. Anyway, PHP isn't a bad tool for a *lot* of web-side scripting, but I'd prefer if I could use Python in many of my work projects. :-) I'd feel happier ! Regards, Gonzalo. -- http://mail.python.org/mailman/listinfo/python-list