You are here: Re: PHP 4.4.4 vs Perl 5.8.7 for Object Oriented server code « PHP Programming Language « IT news, forums, messages
Re: PHP 4.4.4 vs Perl 5.8.7 for Object Oriented server code

Posted by Michael Fesser on 01/29/07 15:47

..oO(www.gerardvignes.com)

>Have you run into a situation where you had to switch from PHP 4.x.x
>to Perl 5.x.x in order to get better performance?
>
>I am using an OO approach to PHP for my website's server code. There
>is one tiny script, with dozens of small objects. Each object is in a
>separate source file.

Same here. A lot of small, highly specialized components. Works very
well and is quite easy to maintain and extend, but the problem is the
overhead in object instantiation, since all these objects have to be
created again and again with every single page request. In fact I'm
kinda reaching the limit of what makes sense to do with OOP in PHP.

But this is something that can't be easily solved with PHP alone.

>It is a bit slow, even when the code doesn't do much DiskIO or MySQL.
>
>My webhost (NetSol) uses PHP 4.4 running on Apache 1.3 and Linux.

Ugly. Much better would be PHP 5.2 (improved memory manager) and a
bytecode cache like APC, which can really speed things up.

>I have to option to use Perl 5.8.7. That is the only alternative they
>give me at this time.
>
>Without doing the rewite, I am trying to determine if I can expect any
>real improvement in performance.

I don't use Perl (I simply don't like it), so I can't say much about its
OOP performance. But I wouldn't expect too much of an improvement.
Whether you create 40 objects in PHP or in Perl - the main problem
remains.

On the long run the solution for me will most likely be an application
server, which avoids the repeated re-creation and re-initialization of
all my application objects. Then they are created just once when a new
session is started and remain in memory, ready to handle any requests.

Micha

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация