You are here: Re: Efficiency question: Overwrite array value, or ask if it is set? « All PHP « IT news, forums, messages
Re: Efficiency question: Overwrite array value, or ask if it is set?

Posted by Alvaro G. Vicario on 07/06/06 19:35

*** Markus Ernst escribió/wrote (Thu, 06 Jul 2006 10:52:50 +0200):
> So I wonder which is more efficient - overwriting the array entry at
> every loop, or checking for it with the if statement.

A quick dirty benchmark with loops and microtime(), using the code you
posted, shows that assigning is slightly faster that testing, running from
command line. The saving ranges from 3% to 6%.

If you're interested in these issues you may like Xdebug and WinCacheGrind:

http://xdebug.org/
http://sourceforge.net/projects/wincachegrind/



--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--

 

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

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