PHP performance tips

PHP performance tips

Google Search Central

15 лет назад

31,815 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Álex Clayton
Álex Clayton - 09.07.2020 22:03

Nostalgic 😍

Ответить
Henrik Andersson
Henrik Andersson - 30.10.2016 19:58

print and echo are statements. Not functions.
" vs ' strings are identical in performance, after compiling.

And where is the genuinely important advice? Nothing about compile caches?

Ответить
David Yew
David Yew - 27.03.2012 13:51

Now I got to know that single quotes are faster than double quotes! Hey... more info should be shared about database speed too! Don't just stop there, please!

Ответить
HellMind ZMaster
HellMind ZMaster - 12.12.2011 14:51

This video its for someone as big as google!, this must be emailed to microsoft instead of make us watching it :D

Ответить
HCkev
HCkev - 26.04.2011 20:19

@benjarriola Actually, in PHP, a while loop will run faster. But the gain is not significant at all(something such as 0.001 seconds for 100000 iterations...), so it's not worth changing all your for loops for while in your scripts

Ответить
demonkoryu
demonkoryu - 23.02.2011 17:32

@realluinnar Wrong. At that point, you're going into load-balancing, DB tuning and caching of all sorts; and if that fails, improve your algorithms. Do you think it makes a difference if a server is 99% or 98% loaded?

Ответить
Wesley Overdijk
Wesley Overdijk - 24.12.2010 02:57

so, you use mysql_* , and try to teach others something... how pathetic.

Ответить
Repox
Repox - 24.08.2009 01:10

lol I actually thought that this google guy was serious for a moment... wait... he is... thats just so sad... and wrong...

Ответить
Srini Sekhar
Srini Sekhar - 20.08.2009 20:03

Never expected this from google, very bad.

Ответить
Usien6
Usien6 - 09.07.2009 03:52

The easiest way to speed up a PHP script is stop using PHP.

Ответить
ThePixelDeveloper
ThePixelDeveloper - 27.06.2009 23:03

These were the most insignificant performance tips ever to exist. Your benchmark towards the end was laughable. I'll bet you $100 you can't find a noticeable performance gain using these. Proper performance tips include "caching database results", "using an op-code cache (APC)", "re-factoring loops", etc. Actually, anything that what wasn't on the video would of been more useful.

Ответить
klimpong
klimpong - 26.06.2009 04:35

Dear Eric, don't put this video on your resume. It might make you look like an amateur, even though you have eight years of experience.

Ответить
chrysalis
chrysalis - 25.06.2009 22:59

It must be a joke. Does Google actually use... PHP? And the first example is priceless. "Imagine if a malicious user had inserted 512Kb worth of characters". Yeah, right, but the real issue is an obvious cross-scripting vulnerability. What a wonderful example. And as pointed out by Noobenstein, PHP does COW for variables. This is nothing but misinformation. It must be a joke, I can't believe this video has been made by Google. Real PHP performance tip: use PHP-FPM.

Ответить
luinnar
luinnar - 25.06.2009 22:28

When you have site with 1kk users/month and more every millisecond is important

Ответить
simoncpu
simoncpu - 24.06.2009 19:58

I'd rather use double quotes for long strings that need lots of variables because it makes the code more readable. I guess these tips only apply if you're expecting a million hits per day or something. Otherwise, it's not worth the hassle.

Ответить
Shane Killian
Shane Killian - 24.06.2009 17:39

How to speed up ASP performance: Switch to PHP. :^P

Ответить