TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 06-25-2009, 01:43 AM   #1 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Arrow PHP Perfomance Tips by the Beloved Google

Google actually has many articles relating to speeding up websites, but as we're a PHP related website, I thought it would be relevant for everybody to see the PHP related video. Naturally!

...You may also want to see the related PHP page.

There's really not much to say about it though. Apart from, this is very over-simplified and who in the world is ever going to be able to maintain their code if they code purely with speed in mind?

After all, I am sure we're all capable of coding in a modular style. But should we? I don't think we should.

Finally, what is going on with his choice of colours in his IDE? Please tell me nobody here uses psychedelic colours!

__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
The Following User Says Thank You to Wildhoney For This Useful Post:
nefus (06-30-2009)
Old 06-25-2009, 01:53 AM   #2 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Those are all small tips of things you should be doing anyways, a decent vid though.

Those colors are a little insane, although I use this theme in Visual Studio for C++ development (I prefer default for any other language).

http://www.agileprogrammer.com/dotne.../07/19030.aspx
__________________

Village Idiot is offline  
Reply With Quote
Old 06-25-2009, 10:44 AM   #3 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

The video made me laugh out loud, which is unusual for Google videos. The biggest tips that a G engineer could think of, to make a video about, were replacing double quotes with single quotes and using echo rather than print. Oh come on!

The web page with more details is not much more helpful either, essentially covering very basic "good practices" Edit: which isn't a bad thing! Does anyone know if this is something new that will be expanded upon or if this is all that G will publish on the subject?
Salathe is offline  
Reply With Quote
Old 06-25-2009, 10:54 AM   #4 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

I think G is sticking with all the basics on speeding up the internet. Although you never know!
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 06-25-2009, 05:24 PM   #5 (permalink)
The Contributor
 
Sirupsen's Avatar
 
Join Date: May 2009
Posts: 53
Thanks: 2
Sirupsen is on a distinguished road
Default

Pretty much agreeing with Salethe. :D
I use theese colors btw.:

Monokai for the win. :)
Send a message via AIM to Sirupsen Send a message via MSN to Sirupsen Send a message via Yahoo to Sirupsen Send a message via Skype™ to Sirupsen
Sirupsen is offline  
Reply With Quote
Old 06-25-2009, 05:54 PM   #6 (permalink)
The Contributor
 
Join Date: Nov 2008
Location: Sweden
Posts: 36
Thanks: 1
hjalmar is on a distinguished road
Default

Quote:
Originally Posted by Sirupsen View Post
Pretty much agreeing with Salethe. :D
I use theese colors btw.:

Monokai for the win. :)
Running monokai aswell for anything and everything, tis awesome!
hjalmar is offline  
Reply With Quote
Old 06-25-2009, 06:03 PM   #7 (permalink)
The Contributor
 
Sirupsen's Avatar
 
Join Date: May 2009
Posts: 53
Thanks: 2
Sirupsen is on a distinguished road
Default

Quote:
Originally Posted by hjalmar View Post
Running monokai aswell for anything and everything, tis awesome!
Which editor do you use? :)
Send a message via AIM to Sirupsen Send a message via MSN to Sirupsen Send a message via Yahoo to Sirupsen Send a message via Skype™ to Sirupsen
Sirupsen is offline  
Reply With Quote
Old 06-25-2009, 06:17 PM   #8 (permalink)
The Contributor
 
Join Date: Nov 2008
Location: Sweden
Posts: 36
Thanks: 1
hjalmar is on a distinguished road
Default

Quote:
Originally Posted by Sirupsen View Post
Which editor do you use? :)
PC - E-texteditor (been a while since it's been up and running now tho :))
Mac - TextMate
hjalmar is offline  
Reply With Quote
Old 06-25-2009, 06:36 PM   #9 (permalink)
The Contributor
 
Sirupsen's Avatar
 
Join Date: May 2009
Posts: 53
Thanks: 2
Sirupsen is on a distinguished road
Default

Quote:
Originally Posted by hjalmar View Post
PC - E-texteditor (been a while since it's been up and running now tho :))
Mac - TextMate
Ah, alright. I use Textmate on my mac too with same scheme, and SublimeText on my PC. However, still looking for a free solution with a proper skin. I might actually end up buying SublimeText for almost only the Scheme. :D
Send a message via AIM to Sirupsen Send a message via MSN to Sirupsen Send a message via Yahoo to Sirupsen Send a message via Skype™ to Sirupsen
Sirupsen is offline  
Reply With Quote
Old 06-25-2009, 06:52 PM   #10 (permalink)
The Contributor
 
Join Date: Nov 2008
Location: Sweden
Posts: 36
Thanks: 1
hjalmar is on a distinguished road
Default

Quote:
Originally Posted by Sirupsen View Post
Ah, alright. I use Textmate on my mac too with same scheme, and SublimeText on my PC. However, still looking for a free solution with a proper skin. I might actually end up buying SublimeText for almost only the Scheme. :D
I see, yeah i love that theme/scheme aswell and that's why i choose the editors i did, not a lot of money anyways(atleast not e-texteditor) so well worth it for a pleasing coding experience ;)
hjalmar is offline  
Reply With Quote
Old 06-27-2009, 07:17 PM   #11 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

It looks as though somebody from PHP has also responded to this video: http://groups.google.com/group/make-...fbe82dd80408cc
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 06-27-2009, 11:24 PM   #12 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

I really wish one of the PHP guys would come out and debunk all of these so-called 'myths' on PHP development.

Anyway, heres my editor, VIM 7!!!!
Currently running 256-xterm, colorscheme desertEx:

(p.s. menu on right is NERDtree)

When using a 16 color xterm, i use colorscheme elflord:


Heres the monokai for vim (running in gvim atm, looks nicer), i may start using this tis' nice!


btw, im using the consolas font from Microsoft, I like it alot!
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
Old 06-28-2009, 03:32 AM   #13 (permalink)
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
Kalle is on a distinguished road
Default

PHP's very own gwynne wrote to them:
http://groups.google.com/group/make-...d80408cc?hl=en

:)

As for the highlight, I guess no-one beats mine which is just the default notepad with no highlight whatsoever. But I do like to use Visual Studio 2008 with auto indent off, and tab size on 8 spaces etc. so its almost notepad just with syntax highlight for the C/C++, but its not much it gives you but thats just fine for me even thought I've never been a fan of syntax highlight while coding ;)
__________________
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is offline  
Reply With Quote
Old 06-29-2009, 11:24 AM   #14 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

Quote:
PHP's very own gwynne wrote to them:
http://groups.google.com/group/make-...d80408cc?hl=en

:)
Yep, but there are plenty more performance tips that people take as fact, it would be really cool if they were officially debunked.

However, I do think that some of his statements do require a proper example and explanation.

I used the benchmarks provided by him for the double-quoted strings, I found that concatenation is still faster (just about, but it doesn't help his cause though),

My benchmark results:
interpolation: 0.0293869972229
concatenation: 0.020761013031006

I do realize he says "interpolation is no slower (and often faster) than single- quoted strings using concatenation."

It would have been a good idea for him to provide an example that would back his claim, that it is 'often faster'.

Another point:
"Depending on the way PHP is set up on your host, echo can be slower
than print in some cases."
Would have also been good to show us exactly where this would be the case, but so far we don't have any real evidence that confirms or denies the performance difference.

All in all, I don't doubt the guy as he clearly has far more knowledge of the internals of the PHP engine than I do, but it would be nice for him to actually back his claims properly and seen as though he portrays himself as 'part of the PHP team' (which I don't doubt, so don't start posting screenshots of PHP CVS commit messages etc, I'm not interested) I would expect some in-depth evidence to prove his case, especially as his evidence seems to be placing egg on Google's face slightly (and many other respected developers I should add).

Until somebody actually comes out and says yes x performance tip is a load of old garbage because ... 'insert suitable explanation here, not JUST benchmarks' then we PHP developers can only ever continue with out current good practices (which according to the post on Google, are now for the most part, incorrect).

On the other hand, I've never been a fan of micro-optimizations too much, the biggest bottle necks come from badly designed code and badly constructed SQL queries, as well as other factors like network latency etc.

To conclude, I am grateful for him taking the time to debunk these so-called 'myths', but I do think he could have explained his case a little better.
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
Old 06-29-2009, 11:54 AM   #15 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Offtopic: sketch, he's a she.

I'm sure sooner or later, Gwynne or someone else will come forward and "debunk" common myths with thorough evidence, benchmarks and/or discussion of precise details but I don't see a problem with Gwynne not doing that in her Google Groups message.

Hopefully the big G will add more pages on the subject of PHP optimisation, perhaps in collaboration with members of the PHP Group, which cover the more usual performance problems, solutions and tips encountered which can really make a substantial difference.
Salathe is offline  
Reply With Quote
Old 06-29-2009, 12:07 PM   #16 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

Quote:
Offtopic: sketch, he's a she.
Oops! sorry, my bad.


Quote:
but I don't see a problem with Gwynne not doing that in her Google Groups message
I didn't say it was a 'problem' per-se, I just argued that some arguments lacked proper explanation, which they do (in my opinion).
If you are going to come out and say 'the performance techniques most of you are using in your applications are a load of bunkum', then you need to properly back it up (I personally would anyway), which I personally don't think she did very well and seen as its the ONLY place its been done (i.e. myths that many people think of as fact 'debunked' by a member of the PHP team, to my knowledge anyway), I would expect it to be explained there, maybe that's just me being pedantic.

I'm sure It will get clarified in the fullness of time.
Quote:
which cover the more usual performance problems, solutions and tips encountered which can really make a substantial difference.
Yes indeed, like I said, micro-optimizations are something of a white elephant when it comes to performance in the real world.
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
Old 06-29-2009, 12:15 PM   #17 (permalink)
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
Kalle is on a distinguished road
Default

Gwynne is also a core developer, and I think she benched against latest 5.3 CVS, the language scanner have been completely rewritten in there, so I think it can easily be a reason why concatentation and interpolation is close.
__________________
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is offline  
Reply With Quote
Old 06-29-2009, 01:17 PM   #18 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

Quote:
Originally Posted by Kalle View Post
Gwynne is also a core developer, and I think she benched against latest 5.3 CVS, the language scanner have been completely rewritten in there, so I think it can easily be a reason why concatentation and interpolation is close.
That's good to hear, but like I said, if she had made that clear, it would have avoided the confusion (that is, if it is the case).

Thanks for throwing that bit of knowledge in though.

I'd just like to point out, I'm not having a go at her, sorry if it sounds like that. I'm in an off mood today, some retard bin-man ( i think) has pranged the side of my shiny car today, so I'm rather annoyed in general.
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
Old 06-29-2009, 02:08 PM   #19 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

That's okay, sketch! You earned yourself a new user title, though. I wonder who did that...

Edit: This isn't you today, is it: http://www.youtube.com/watch?v=Hqb6AbGCeC8#t=02m57s

__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 06-29-2009, 02:10 PM   #20 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

HAHAHAH

Now I wonder who could have done that? Nope I'm stumped!
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Thread Thread Starter Forum Replies Last Post
Tips: Fastest PHP Code jordie Tips & Tricks 8 05-14-2013 12:47 PM
10 PHP Myths Dispelled Wildhoney General 9 06-15-2009 06:55 AM
PHP Compressor Kalle Script Giveaway 8 05-28-2008 12:14 AM
40 Tips for optimizing your php Code - Really? Wildhoney General 10 12-14-2007 08:42 PM
Tips: PHP security Village Idiot Tips & Tricks 22 11-23-2007 11:17 PM


All times are GMT. The time now is 12:49 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design