Hi,

I am still working in D6 and have done a lot of hacking around. ;-)
There are some things I changed for performance reasons. I searched if these are going to change for D7 but could not found it.

My changes are mostly based on this article:
http://www.hm2k.com/posts/50-php-optimisation-tips-revisited (I hope it is trustworthy ;-)
And I have read an article from someone else who had made a script a test/benchmark some of these tips, but i cant find that one of course :-(

Some of the most seen/changed things are:

  • function-calls in a loop article #5
    foreach(some_func() as $item){}
    some_func() will be called each loop!
  • pre-increment is faster article #26
  • sinlge quotes article #2
    sometimes i need to change a string (with variables) from double-quotes to single-quotes
  • nested function calls
    ok, this is not a performance-issue but it is much more readable when not everything is pushed into one line
    Maybe it even gives a better performance. But i mostly split those calls in smaller parts, so i can see what happens

Not all tips are usable, cause some things are to handy to stop using them ;)

Is it with a reason that these things are not optimized in D6? So that it should not be changed?
Else: a request to change those things in D7

Greetz, Joly

Comments

joly’s picture

Priority: Normal » Minor
Issue tags: +Performance, +PHP, +optimization
joly’s picture

Priority: Minor » Normal

Sorry, forgot the tags. Editing seemed not possible

Damien Tournoud’s picture

Status: Active » Closed (duplicate)

Those are considered to be micro-optimizations. If you believe that those change can have a significant impact on the overall page rendering time, please join the effort in #513984: Find bottlenecks in HEAD - meta issue.