Archive for August, 2007

Javascript parsing: bootleneck?

While hacking on performance and a soon to be released customer site, it occurred to me that parsing the JavaScript we use is a pretty huge bottleneck. For CSS and JavaScript we use minification and compression and we even use domain aliases to parallel image/resource downloads.

We currently haven’t the templates connected to the CMS yet, but the raw time is currently between 700 and 900ms. Maybe it can be justified because the layout isn’t Web 1.0 style (i.e. many round corners, shadows, etc.).

What puzzled me was the “loading time of JavaScript was around 300ms”, see this picture:

Loading and parsing time of JavaScript

That’s quite a long time. It may is not that good visible from the chart, but nearly everything following the JavaScript is hold until it is read, which delays the complete loading of the rest of the page.

Since behind the scenes the actual request is in reality using Minify, it’s not just plain serving (but for this scenario the JavaScript has already been cached).

So I took a look just at the JavaScript loading, see this:

Just loading, like text.

What’s that? Roughly 30ms vs 300ms?

The only realistic guess I’ve at the moment is: parsing the JavaScript.

This single request loads the following libraries:

  • behaviour
  • prototype
  • scriptaculous (+effects)
  • yui: yahoo-dom-event
  • yui: container_core
  • yui: menu.js
  • our own small JavaScript parts

Maybe I’m too optimistic but it hit me a bit that JavaScript parsing still does take so long. Given that the JavaScript is cached (ideally) things such a huge problem, but still. It was frustrating that I could trim down the >1s request to ~700ms but not further and for most of the part just because it takes as long as it needs it.

1 comment August 17th, 2007

Very short URLs with Mediawiki

When it comes to configuring Mediawiki to have very short URLs, according to the Mediawiki documentation it seems the possibilities are endless. It you go through he page, in Austrian we would see it’s like “Kraut und RĂ¼ben”, which means something like it’s a mess, unordered, crowded.

My simple goal was: have the shortest possible article URLs, ideally http://server/Article and not http://server/dir/index.php/Article.

With a simple .htaccess file and some modification to the LocalSettings.php I was able to get it working:

.htaccess File:

RewriteEngine On
# Backward compatibility for old installation
RewriteRule ^wiki/index.php/(.*) http://intranet.netcare.at/$1 [R=301]
# Only rewrite uppercase Words because they signal the title for the pages to
# handle. Everything in lowercase is expected to be "internal"
RewriteRule ^([A-Z].*) index.php?title=$1 [L,QSA]

LocalSettings.php changes:

$wgScriptPath = "";
$wgScript = "/";
$wgArticlePath = "/$1";

This is simply a “it works for me” scenario. I did some testing and it seemed everything is working fine. However I also think the way I use Mediawiki just scratches the surfaces. We’ll see if it works out.

Add comment August 10th, 2007


Calendar

August 2007
M T W T F S S
« Jul   Nov »
 12345
6789101112
13141516171819
20212223242526
2728293031  

Posts by Month

Posts by Category