You are here: Re: [PHP] php cli script with if-then's very slow « PHP « IT news, forums, messages
Re: [PHP] php cli script with if-then's very slow

Posted by "Richard Lynch" on 10/19/40 11:24

On Thu, August 18, 2005 2:14 am, Frans Fierens wrote:
> I've noticed that php cli scripts using for-loops with some
> if...then's
> are very slow using the php cli (command line interface). The
> following
> php script takes somewhat 100 seconds (php v5.0.3 on a redhat linux, 3
> Ghz PC). The same program in c (see below) less than 1 second ... I
> know
> that php is a scripting language, but isn't the difference between de
> c
> compiled prog and de php script not very extreme ?

In the unlikely event that you ever need code like that in a real-life
application, write that part of your code in C as a Module for
Apache/PHP.

A cache like the Zend cache would maybe help a LITTLE as it will parse
it all to byte-code only once. Though I suspect it won't help that
much, as it will still have run through that byte-code over and over.

Do feel free to write all your web server application in C if
performance is your primary consideration. :-)

--
Like Music?
http://l-i-e.com/artists.htm

 

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

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