TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Tips & Tricks (http://www.talkphp.com/tips-tricks/)
-   -   PHP Perfomance Tips by the Beloved Google (http://www.talkphp.com/tips-tricks/4603-php-perfomance-tips-beloved-google.html)

Wildhoney 06-25-2009 01:43 AM

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!


Village Idiot 06-25-2009 01:53 AM

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

Salathe 06-25-2009 10:44 AM

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?

Wildhoney 06-25-2009 10:54 AM

I think G is sticking with all the basics on speeding up the internet. Although you never know!

Sirupsen 06-25-2009 05:24 PM

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

Monokai for the win. :)

hjalmar 06-25-2009 05:54 PM

Quote:

Originally Posted by Sirupsen (Post 26057)
Pretty much agreeing with Salethe. :D
I use theese colors btw.:

Monokai for the win. :)

Running monokai aswell for anything and everything, tis awesome! ^^

Sirupsen 06-25-2009 06:03 PM

Quote:

Originally Posted by hjalmar (Post 26059)
Running monokai aswell for anything and everything, tis awesome! ^^

Which editor do you use? :)

hjalmar 06-25-2009 06:17 PM

Quote:

Originally Posted by Sirupsen (Post 26060)
Which editor do you use? :)

PC - E-texteditor (been a while since it's been up and running now tho :))
Mac - TextMate

Sirupsen 06-25-2009 06:36 PM

Quote:

Originally Posted by hjalmar (Post 26061)
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

hjalmar 06-25-2009 06:52 PM

Quote:

Originally Posted by Sirupsen (Post 26062)
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 ;)

Wildhoney 06-27-2009 07:17 PM

It looks as though somebody from PHP has also responded to this video: http://groups.google.com/group/make-...fbe82dd80408cc

sketchMedia 06-27-2009 11:24 PM

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!

Kalle 06-28-2009 03:32 AM

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 ;)

sketchMedia 06-29-2009 11:24 AM

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.

Salathe 06-29-2009 11:54 AM

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.

sketchMedia 06-29-2009 12:07 PM

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.

Kalle 06-29-2009 12:15 PM

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.

sketchMedia 06-29-2009 01:17 PM

Quote:

Originally Posted by Kalle (Post 26287)
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.

Wildhoney 06-29-2009 02:08 PM

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

:-)

sketchMedia 06-29-2009 02:10 PM

HAHAHAH

Now I wonder who could have done that? Nope I'm stumped!


All times are GMT. The time now is 10:53 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0