November 2008

Let's Be Upfront About Performance at DrupalCamp NJ

I just presented "Let's Be Upfront About Performance" as a session at the inaugural DrupalCamp NJ.

My presentation is embedded below. Go forth and make fast websites!

"Let's Be Upfront About Performance", by Steven Merrill (DCNYC10)

Steven Merrill presented "Let's be upfront about Performance" as a Community Spotlight session at DCNYC10; below is his deck. Feel free to ask questions in the comments!

CapitalCamp was Awesome!

This past weekend was CapitalCamp, Washington DC's first DrupalCamp, and Treehouse presented three exciting sessions.

Treehouse CEO, Michael Caccavano, was on a panel with fellow CEOs of web technology companies in Growing a Drupal Agency Beyond the Garage.

Steven Merrill and I talked about guidelines for web performance optimization, techniques for improving front-end performance, and ways to automate the testing and monitoring of front-end functionality in Pages on a Silver Platter: Automated Front-End Testing and Tuning. If you saw this talk, we'd love your feedback! Please leave your quick review here: http://tha.cm/capitalcamp-front-end-testing

Then, Patrick Macom and I presented on Raphaël JS, an interactive drawing library for vector graphics on the web. The session covered the basics of the Raphaël JS API and then moved into integration strategies with Drupal in the talk, "Outside the Garden: Intro to Raphaël JS." If you saw this talk, we'd love your feedback! Please leave your quick review here: http://tha.cm/capitalcamp-raphael

Coat Your Website in Varnish

Last week at the Drupal NYC meetup, I gave a presentation about the Varnish reverse proxy cache.

Scaling Drupal: Not IF... HOW

Thanks to all those that braved the early morning to attend our session at Drupalcon DC.  We think it was a good warm-up for the full track of excellent performance and scaling sessions on Thursday.  See you next year!

Abstract
What do Fast Company, The Big Money, The Onion, Lifetime Television, SonyBMG, Flex.org, DressupChallenge.com, and NowPublic have in common?

All are popular sites, some with traffic of a million or more pageviews a day. But there's more.

They all run on Drupal.

Some people still ask if Drupal can scale. We say, "It's not a question of IF, but HOW".

Come and hear how we scale sites like myLifetime.com, TheBigMoney.com, and DressUpChallenge.com.

Speed Up and Version Your Views

Since getting started with Drupal over two years ago, the sites I’ve built with it have naturally gotten bigger and bigger in scope. As your sites get bigger and bigger, you always look for ways to keep your site running as smoothly as possible, and this usually ends up meaning getting rid of queries wherever you can.

One feature of Views which is often used by module developers is the ability of a module to expose a set of default views. The calendar module, for example, provides a default calendar view in both its Drupal 5 and 6 versions. This is an obvious asset for developers of contributed modules: if your module interfaces with Views, it makes sense to provide a default view that users can modify.

Implementation and Potential Benefits

The hook used to do this is hook_views_default_views(). Since most modern sites are run off of a number of Views, you can also realize several benefits by building your sites with a custom module that implements hook_views_default_views():

  1. It improves performance. Views implemented via hook_views_default_views() do not require a database query to instantiate. You will realize an even greater performance gain if you also use an opcode caching system such as APC or XCache.
  2. Providing views in code will allow you to override the default view to make changes, and you can then choose to keep the changes in the database, update the module file to reflect the changes, or revert back to the version in your module file.
  3. Because the view (and theoretically, changes to that view) are stored in files, you can put them in version control and see how the views used in your site change over time and revert to an earlier version without having to go to a database backup.