Recently I revised Optimizing PHP, an article that I wrote in 2002.
I'm pleased to say that it hasn't aged much. The changes I had to make
include a recommendation to use FastCGI with IIS, adding Turck MMCache
to the opcode cache list, recommending Cache_Lite, replacing foreach
with list/each for large arrays, and the realisation that arrays need
to be passed by reference too.
Then I realized how much more I could have discussed. I started to
think more about performance profiling after discussing APD in a
previous post.
Now there is some logic to the fact that functions with many lines of
code will run slower than ones which are short and brief.
However sometimes it's the shortest code snippet that cause the real
slowdowns. That's because these code snippets call external functions
that hide a lot of complexity behind a deceptively simple and light
exterior. With any of the following natural born killers, one
thoughtless line of code can result in a unbearable x100 times
slowdown:
SQL statements - for example, adding a simple ORDER BY clause to a
query could cause a massive slowdown because all records will have to
be obtained on the server and sorted first before it is sent to the
PHP client.
Regular expressions - because regular expressions work by
back-tracking when a match fails, its common for a regular expression
to be exponentially expensive to compute. The longer the string, the
worse it becomes.
Network calls - the increasing popularity of SOAP and similar
inefficient but easy-to-use protocols open up new vistas of
unscalability for the unwary.
Classic performance tuning techniques used by XDebug and APD give you
a summary of all functions with long execution times. This is useful,
but we need tools to easily pinpoint, measure and tune the overhead of
killers such as SQL statements, regular expressions and RPC calls. I
think that we already have enough Open Source CMS projects out there.
Tuning tools like this are great idea for students and developers with
time to kill, looking for an interesting Open Source project to start.
Grok Headline matches for Natural Born Killers of PHP
Natural Born Chatter v2.9.7
Natural Born Chatter v2.9.703/19/2003 10:45 PM Natural Born Chatter is a multiple-mode user-friendly network
communication utility, including real-time chat, instant messaging and
exchange of files. It is intended to be used in small office or home
office (SOHO) local networks.
"While a business process is running," an IBM white paper on BPEL4WS
dryly notes, "it might be necessary to undo one of the steps that have
already been successfully completed." Translation: Things can get
screwed up, and then they need to be fixed. If there's anything
revolutionary about Web services, it's the notion that we'll be able
to deal with the inevitable screwups in more realistic and more
effective ways. Compensation can't simply mean what it does to a
programmer: chaining back through a nested series of automatic
exception handlers. We have to accept that it's often people who both
throw and handle the exceptions, and we have to build software systems
that gracefully include them. [Full story at Inf
oWorld.com]
This short article, part of InfoWorld's special
report on Web services, touches on some things I'll say more about
in my talk at XML
2003 next week.
...
-David Halberstam
, Author, ``The Best and the Brightest``
Intel Labs' Natural Born Killer Technologies
Intel Labs' Natural Born Killer Technologies05/06/2004 09:45 PM Rob Enderle visits Intel's Lab to see what's in the fab. And what he
finds should give IBM and Apple reason to grab their torches and
pitchforks.
Natural Born Nomi: Jedi Journals Update
Natural Born Nomi: Jedi Journals Update09/15/2004 07:31 AM This weeks update to the Jedi Journals
completes the first series of Tales of the Jedi. We are
introduced to Nomi Sunrider, Master Thon, Oss Wilum and more
characters than you can shake a lightsaber at! Today's update also
features Dark Horse Comics #7-9, which was the first appearance
of Nomi and her Tale.
Finally with these additions Jedi
Journals has reached 100 issues. Whew! Only 570+ more issues to go!
It's only natural: Evaluation natural-language dialogs (VoiceXMLPlanet.com)
Google killers07/22/2004 12:57 PM Source: apcmag.com - Can Google’s armoury fight off the swelling ranks
of rivals? Simon Sharwood checks out the future of Internet
searching....
With innovative services and snazzier phones, the telecom players
figure they can swipe a chunk of the digital music market that Apple
cracked open with its iconic iPod. By Roger O. Crockett,
BusinessWeek
Spyware-killers get going online
Spyware-killers get going online06/28/2004 06:01 PM Congress is moving fast on digital pests. Security firms may already
have part of the answer.
Find car crash killers, son says
Find car crash killers, son says01/02/2005 07:03 PM The children of a couple killed in a crash with a stolen car in
Birmingham appeal for information to find their killers.
'Plan' to set Garda killers free05/07/2004 06:14 AM The killers of an Irish police officer were to be released as part of
a deal to restore the NI assembly the BBC learns.
"Why should we talk to people who are child killers?"
Files released on women killers05/02/2004 06:00 AM Court records revealing details of English murders by women from the
early 20th century go on display.
US vows to catch hostage's killers05/12/2004 01:18 AM America vows to catch the killers of Iraq hostage Nick Berg who filmed
themselves cutting off his head.
Bush: Berg's Killers Must Be Hunted Down (AP)
Bush: Berg's Killers Must Be Hunted Down (AP)05/15/2004 10:03 AM AP - President Bush is focusing on the killers in Iraq who beheaded
American civilian Nicholas Berg, insisting they must be hunted down as
part of a strategy ultimately designed to bring peace to the
U.S.-occupied country.
Nano Killers Aim at Mini Tumors
Nano Killers Aim at Mini Tumors06/22/2004 05:53 AM Two nanotechnologies under development hone in on proteins produced by
bloodthirsty cancers, allowing doctors to find tumors as small as 1 mm
across. By Kristen Philipkoski.
All the "iPod killers" out there promises more features than iPod:
Here's a list of features not found on iPods. FM radio, check. Support
for Microsoft music rental service, check. Microphone,
check.
Hey guys, how about giving us new functions,
rather than just a checklist? How about TiVo-like time-shifting of
local radio programming? How about Amazon-like music and podcast
recommendations based on what I like to listen? How about Newton-like
personal assistant based on my dictation?
Europe's five worst child killers06/17/2004 09:09 PM A third of deaths of European children and adolescents are down to
just five causes, the World Health Organization says.
PHP-Help.net is born !
PHP-Help.net is born !04/11/2005 03:27 AM PHP-Help.net is born today, a few days before Christmas.
Its main goal will be to build a database of explained PHP source
codes.
It is dedicated to both beginners and confirmed PHP developers:
It will bring to the new developper some PHP usage examples,
and allow experienced developers to submit their codes to community
in order to improve it. We hope you will enjoy our work,
Matt <matt@php-help.net>
Teenage 'gay-bashing' killers jailed
Teenage 'gay-bashing' killers jailed07/01/2004 08:57 AM Two teenagers who set out to target a member of the gay community are
sentenced for murder.
Garda killers 'will serve term'05/10/2004 02:57 AM The killers of an Irish police officer will serve their jail term
unless there is an end to IRA activity, a minister says.
Killers: Beheading Avenges Prison Abuse (AP)
Killers: Beheading Avenges Prison Abuse (AP)05/11/2004 07:30 PM AP - A video posted Tuesday on an al-Qaida-linked Web site showed the
beheading of an American civilian in Iraq and said the execution was
carried out to avenge abuses of Iraqi prisoners at Abu Ghraib prison.
CNN.com - U.S. vows to find American's killers - May 12, 2004
CNN.com - U.S. vows to find American's killers - May 12, 200405/13/2004 03:45 AM one of our citizens is captured and brutally slaughtered .. U.S., Iraq
vow to hunt down killers of American hostage .. decapitacin de
Nicholas Berg .. did not sound like
him
cnn.com/2004/WORLD/meast/05/12/iraq.berg/index.html track this
site | 5 links
Iraq to Offer Amnesty, but No Killers Need Apply08/03/2004 11:43 PM A plan to offer amnesty to Iraqi insurgents moved forward, but those
who killed either Americans or Iraqis will not qualify.
More Killers Gaining Parole (Los Angeles Times)
More Killers Gaining Parole (Los Angeles Times)09/18/2004 05:45 AM Los Angeles Times - SACRAMENTO — For all his tough-guy swagger,
Gov. Arnold Schwarzenegger is quietly pursuing one of the most
permissive parole policies California has seen in years, freeing
convicted murderers in numbers that dwarf those of his two
predecessors.
Iraq to Offer Amnesty; No Killers Need Apply08/03/2004 09:51 PM A plan to offer amnesty to Iraqi insurgents moved forward, but those
who killed either Americans or Iraqis will not qualify.