« PHP Debugging with XDebug | Main | PHP Quebec Winds Down »

March 31, 2006

Rasmus Lerdorf: Fast and Rich Apps

At PHP Quebec listening to Rasmus Lerdorf (creator of the PHP language) presenting on using PHP to create fast and rich web applications. The focus is on using things like XML and AJAX to create web pages with less user-noticed reloading (that's the rich part).


Gives an example of using XPath in PHP 5 and applying an XSLT stylesheet. A look at how Rasmus does XML processing in PHP (prefers SimpleXML). Gives a single-line example of grabbing a feed from Flickr to show recently uploaded photos.

Then goes on to providing and consuming SOAP services with code to demonstrate how it's done. A pretty siimple snip of code to provide and use web services (for this example).

Rasmus throws up a slide that shows the top 15 searches of the day for Yahoo (there are a few comments about what people are searching for as the audience looks down the list). Then he takes that information, grabs the number one image for that search, plots those images along an ellipse and outputs in html in the browser. A cool looking ellipse of images that you can mouseover and see. Rasmus built it about a year ago and left it up for a few weeks. When he took it down he got enough complaints that he put it back.

Rasmus shows another cool app that he built to move photos from his local web-based gallery to Flickr. All on a single screen in a web browser. Added a bit of eye-candy. The app shows the gallery images on the left and the Flickr account on the right and if you click on the image in the left it bounces over to the Flickr window.

Shows the geocode API from Yahoo! for creating a page that has a list of Yahoo! maps. Really cool navigation with Javascript and some Flash. He extends that by plotting earthquakes from an earthquake RSS feed.

The presentation goes into detail on using the MVC model and how it maps to web-based applications.


Rasmus gives a scenario of a sample web site with 500,000 users and looks closely at how many requests, response times, and number of servers you'd need to be responsive. Runs apache in callgind to follow application and where it's spending time. Sort of like a debugger in that you step through the pages in the app and see what places in the code are taking what kind of time. Rasmus is using PostgreSQL, and finds in the callgrind output that much of the app time is spent negotiating SSL connection with PostgreSQL. SSL is on by default, but it's not needed here. Turns it off and gets much better performance.

Switches app over to MySQL, gets much better performance. Queries using MySQL non-persistent connections are faster than Postgres persistent connections.

Looks at APC and subtle ways to get pieces of code cached. Better off having longer, but fewer include files in PHP for performance.

Presentation is here. Includes the slick Web 2.0 app code.

Posted by mike at March 31, 2006 1:03 PM