Revenue Source

Welcome to the Revenue Source affiliate marketing forums.

You are viewing our internet marketing and SEO forums as a guest which gives you limited access to most of our discussions.  By joining our free community, you will have access to post affiliate marketing topics, communicate privately with other members (PM), exchange SEO strategies, and access many other special features.  Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems, please don't hesitate to contact us.

Go Back   Revenue Source > Site Design & Development > Programming Help
Reload this Page Joakim Nygard's Blog: Optimizing PHP Through Habits
Tags: , , , , , ,

Reply
 
LinkBack Thread Tools Search this Thread
Old
  (#1 (permalink))
Affiliate Blogs is Offline
Revenue Source Veteran
Affiliate Blogs has a brilliant future here!
 
Affiliate Blogs's Avatar
 
Join Date: Oct 2005
Posts: 9,157
Jack of All Trades
CyberSpace United States
   
Joakim Nygard's Blog: Optimizing PHP Through Habits - 04-25-2007

Spurred on by some previous benchmarks [pdf] from Ilia Alshanetsky, Joakim Nygard decided to run some his own benchmarks on the same sort of functionality.
There are numerous discussions in the blogosphere about whether to use echo versus print, if for() is faster than while(), etc. and though the gains are usually very small, I decided to add my thoughts to the debate. I found an article on optimization through coding habits in Ilia Alshanetsky's zend performance slides.
According to his results:
  • Calling require_once() 10000 times in a for() loop with an empty file is 4x faster.
  • With a simply autoload requiring a class and 10000 loops of new Foo() versus require_once('foo.php'); new Foo() shows that __autoload() is ~3.7 times faster.
  • If a class method can be static, declare it static. Speed improvement is by a factor of 4.
  • Avoid function calls within for() loop control blocks
  • Always, always quote array keys.Get rid of 'harmless' error messages - they take time to generate and output.
I am not out to prove Ilia wrong - he knows PHP better than most - and for all I know, they could have optimized those very functions in PHP 5.2. [...] It would appear that there are improvements, albeit small, to achieve from minimal effort. Plus I was surprised by the discrepancies I found compared to Ilia's recommendations.
Joakim Nygard's Blog: Optimizing PHP Through Habits - Read More...
  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads for: Joakim Nygard's Blog: Optimizing PHP Through Habits
Thread Thread Starter Forum Replies Last Post
My Daily Success Habits - I?ve Been TAGGED, Look Out Affiliate Blogs Affiliate Marketing 0 04-24-2007 11:45 PM
Bard Farstad's Blog: Optimizing Apache, PHP and APC for Intel based Mac Affiliate Blogs Programming Help 0 04-18-2007 04:28 PM
Optimizing Your Website for MSN elecky Goofing Around & Program Discussion 1 02-22-2007 06:21 AM
Optimizing Your Website for Google elecky Goofing Around & Program Discussion 0 02-20-2007 06:57 PM
Optimizing For MSN Search ValiantMarketer Search Engine Optimization / Marketing 0 11-19-2004 11:08 PM



© 2004-6 RevenueSource.com.  All rights reserved.  Do not duplicate or redistribute in any form.
This website and its logos/design are property of RevenueSource.com.  All rights reserved. vBSEO 3.2.0 RC7


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34