Reply to Re: What performs better, theoreticaly?

Your name:

Reply:


Posted by NC on 04/23/07 15:44

On Apr 23, 7:39 am, "Rolf Mander" <rolf.man...@spam.com> wrote:
> What performs better, theoreticaly?
>
> echo date("d",time());
> echo date("m",time());
> echo date("Y",time());
>
> Or that?
>
> $time = time();
> echo date("d",$time);
> echo date("m",$time);
> echo date("Y",$time);

Theoretically (and assuming that your question is more general than
the example you gave), it depends on what system resource is
constrained. If it is memory, the first would work better (there is
no additional variable required); if it is CPU, the second is better
(one function call instead of three).

> when does it get relevant?

Very rarely, unless you are building something quantitative. The
resource that usually gets constained first is disk I/O.

Cheers,
NC

[Back to original 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

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