So, Firefox 3.6 is finally here, and on average it’s 20% faster than 3.5. It’s actually a really noticeable improvement for both rendering and scrolling around pages; I’d say it’s more or less on a par with Safari on most pages. I hear from Windows using friends that it’s similarly quicker on that platform too, approaching the speed of Chrome, in places. All of which makes this a little odd.
I noticed, not long after the upgrade that my blog (this page, unless you’re reading a syndicated copy,) was scrolling really, really slowly in Firefox, which it had never done before I upgraded. I checked it in Safari to reassure myself that it wasn’t something wrong with the site, and everything was fine; scrolling was smooth and responsive just like it has always been. I checked Firefox 3.5 on my macbook; same thing. I disabled all my firefox addons and tried again on the desktop: still painfully slow. So I re-enabled some of them and started messing around with firebug, disabling various style elements to see if I could figure out where the slowdown was coming from.
It didn’t take me long to find the culprit: shadows. I try to avoid using images in my pages as much as possible to improve page load speed, so I use box-shadows to give a bit of depth to the widget box-outs; they look even more flat and drab without them. I also find that a subtle text-shadow is a great way to increase text contrast without making the page harder on the eyes, which is a big deal for any light-on-dark display (at least until someone introduces a decent super-light websafe font,) so I make heavy use of that too. None of this has ever had any noticeable performance impact before, but here we are; with the new, optimised, gecko engine it renders like arse.
I thought perhaps there was something else about my CSS that was confusing the rendering engine — it’s hardly the most minimal or elegant set of style definitions in the world — so I knocked together this abuse of text-shadow to prove that it’s the problem. As expected, it renders fine in Safari and older Firefoxes, but incredibly slowly in Firefox 3.6, so it’s definitely something to do with the new browser.
Next check was to see if it affects FF3.6 on other platforms, so I fired up my Wintendo, upgraded Firefox and tried the page. No slowdown. I don’t know how representative that is though; that box is a quad-core 3GHz Nehalem with 6GB of RAM and a GTX295 in it; it’s got about twice the graphics oomph of my Mac (which is a 3GHz Core2 Duo with an 8800GS), and I don’t have a slower windows box to test on. So this is a bit inconclusive; I can’t really detmine whether the issue is confined to the Mac version of Firefox, or to Firefox on machines that can’t run Crysis at 60fps. But, honestly, I don’t think it matters.
Long story short; my site renders really slowly on the latest, greatest version of Firefox, which is an issue. I make no bones about the fact that I don’t give a monkey’s how it renders in IE, but I do like to make sure it gives a good experience in decent browsers, which by my definition means anything webkit or gecko based. Firefox is by far the most popular browser in that category, so I can’t just ignore this. The question is what to do?
I can sit around and hope that 3.61 fixes the problem, but that is basically just ignoring it, taking no responsibility, and means that my site sucks until someone else fixes their browser, which might never happen.
Or I can reskin the whole site such that it looks OK (or at least as OK as it looks now) without relying on shadows. The problem is, I’m not a web designer, so that’ll take me ages, and I only just got the place looking how I want with this design. It’ll also, inevitably, mean moving back towards the bad old way of doing things, using background PNGs to try to give the site any sense depth or character, and I really don’t want to do that; I want to be able to use stylesheets to define the style of my page, not rely on image-based workarounds. Admitting that I need those workarounds feels like giving up. Maybe the state of browser technology just isn’t up to that outlook yet.
Basically, I see no entirely satisfactory way out of this situation; I’m just going to have to decide which solution is the least unsatisfactory. I’m going to have to give it some thought.
Tonight I upgraded the Wordpress install on the site to version 2.8, resulted in about half-an-hour’s downtime while I untangled some merge conflicts the svn update to 2.8 combined with a move to the new Wordpress core svn server created. Interestingly the process went fine on my test server, but not on live; I’ll have to look into that. Anyway, apologies for any inconvenience the downtime may have caused you.
The 2.8 upgrade itself is almost entirely back-end, admin stuff, and shouldn’t have any impact on the visible site at all.
A few months back, I quietly added gravatar support to the site for commenters. I didn’t mention it, as I (apparently incorrectly) assumed almost everyone had a gravatar.
Since that’s turned out not to be the case, I’ve installed the excellent WP-monsterID plugin to generate avatars for those commenters that don’t have one. It’s really quite clever: it takes a hash of the commenter’s email address and uses some of it as a seed for a procedurally generated monster. There are millions of possible combinations, and as long as you keep using the same email address in your comments, you’ll always get the same monster. An even cooler side effect is that, you’ll take that monster with you to any other site that uses the same (sort-of-standard-ish) monster-generation code.
Of course, if you create yourself a gravatar, that will override your monster avatar, as well as appearing on all of the many sites around the net with gravatar support.
If you’ve commented here before, you can check back to the old posts, to see what your monster looks like. If you haven’t; feel free to comment on this post, for an example.
I just switched the site to route subscriptions through feedburner (mainly out of interest.) It should be pretty seamless, but if you find your feed has repeated entries or anything, that’ll be why; it shouldn’t persist.
If you’re both observant and one of the rare people that actually visits the site, rather than just reading via RSS, you might have noticed that I’ve decided to experiment with Twitter. My username is AggroBoy, and you should be able to see my updates in all the usual twitter ways. Or you can just look at them there on the sidebar.
Why Twitter? Well, it’s a bit more immediate than regular blogging, and should allow me to just throw random thoughts or things that have happened to me on the spur of the moment, rather than having to wait and compose a full blog post about it, which almost never happens. Of course the worry is that more or less exactly nothing ever happens in my life, so my twitter feed runs the risk of being either empty or mind-destroyingly boring. And that’s why it’s an experiment; I’ll give it a couple of months and see if I’m actually using it, and if I’m happy with it. If I am then I’ll keep at it, if not it gets relegated to the recycle bin.
Obviously, I’ll keep updating the main blog with the things I want to express eloquently (well, as eloquently as I can,) or at length; the intent is that twitter contains an entirely different kind of information.
You should now be able to edit your comments for half an hour after submission. I had a bit of trouble getting it working alongside the comment subscriptions, but I think I’ve got it sorted now. It all worked in my tests anyway.
Let me know if you have any trouble with commenting, or not being notified with your subscriptions.
Those of you who don’t read this through an aggregator will have noticed that I’ve got a new theme on the site; and those of you who do might want to actually visit the site briefly to check it out. It’s called Red Wave, and it’s designed by Askgraphics (there’s a link at the bottom of every page,) who seem to have done a bang up job of it. They had a couple of other nice looking ones on their site, but one of them was blue (which just so mainstream,) and the other had a couple of weird rendering artifacts, so this was the one I went with.
This was a pretty hard thing for me to do, since I’d always intended to put my own theme together, but it’s about time I admitted to myself that that isn’t going to happen (I’m a good programmer and a passable writer, but my web-site design skills are sorely lacking,) and it’s better to bite the bullet now, face facts and get myself a look that isn’t the same as every other wordpress blog on the net.
So, what do you all think of the new look? Better? Worse? Don’t care?
The observant amongst you will have noticed that I went for option 3. MT was just not doing what I needed it to, and when I installed Wordpress in parallel to trial it, it did everything I need more or less without fail.
It’s taken me a couple of days to transition (which, combined with a new job, is why the blog has been quiet,) but I’m there now, and shouldn’t be changing again1. Expect the blog to be back to normal(ish) levels of posting.
- Until the next big thing comes along. [↩]
About a month ago, I upgraded the blog to run on the new release of Movable Type: 4.0. It has a nicer interface, plenty of neat features out of the box (without having to manage a host of plugins) and features some handy improvements to the template language it uses to build pages. It delivers on everything it promised, and in all, I’d call it a good upgrade over the venerable version 3, which I had been using. Of course this is technology and there are no absolutes, and MT4 has some serious gotchas, which I’m having a varying degree of success working around.
The first thing I noticed when I upgraded was all those improvements to the template language made my existing templates obsolete. This one’s not a deal-breaker; I just picked my favourite stock theme and ran with it; I can change it later. In fact, you could call this a win, since my existing templates were a mess, and had been hacked together before I really knew what I was doing; this is a chance to make a clean start — isn’t that what every developer always wants?
Slightly more seriously many of the well known and popular community plugins don’t work with MT4 — they’ve changed the way certain things work, and that means trouble for any plugin that relied on things happening the old way. The big loss is the blogroll plugin. There’s an upgrade to the plugin on the way, and I can live without it for a while, I just wish I didn’t have to. Actually, I’m not sure why SixApart haven’t rolled that particular plugin into the main distribution yet. Many of the new features present in MT4 are actually just plugins that have been made part of the default distribution, so why not something so widely used as the blogroll plugin? Beats me.
Of course, if all of the problems were little issues like that, which will go away with a bit of time and/or effort, I wouldn’t even be writing this. There’s a great big chunking problem that is actually starting to make me regret going with MT: performance.
MT4 is slow, and when I say slow, I mean really slow. It pre-generates the site (the much maligned re-building step you’ll hear the Wordpress users going on about,) so the user facing side of the site remains nice and quick, but the administrative interface feels like it’s running on a ZX-81. When I first installed the MT4 upgrade, the dashboard took about 6 seconds to load, compared to well under a second for any of the generated pages, so I know it’s the MT backend cgi scripts that are at fault, rather than my webserver or the network infrastructure between here and my host. Installing memcached and moving my virtual server to a much faster machine have made a noticeable difference, but it’s still taking 3 – 4 seconds to load any of the administrative pages, and when you’ve got a few things to do that gets really annoying, really quickly.
Enter FastCGI. This is an apache extension that keeps the perl runtime and compiled perl code of cgi scripts in memory, drastically reducing the start-up time of those scripts. Creating and starting a new process is a relatively time consuming operation, and compiling the perl code takes time too, so taking those two actions out of the startup of a cgi script can have a dramatic effect on the time taken to serve requests. I’ve trialled this, and it makes a huge difference: combined with memcached to cache the database connection, it makes the admin pages run about as quickly as the static pages. That’s impressive, but it comes with a cost.
Because FastCGI keeps CGI scripts in memory between runs, any memory that they allocate stays allocated too. That’s not a problem in the normal case, but it means that if your CGI script has a memory leak, that the leaked memory is lost for the duration of the FastCGI session (which is usually a couple of hours, at least,) and worse, is lost again every time the script is executed.
Predictably enough, MT4 has a memory leak. It seems to lose about a megabyte of memory every time it’s called under FastCGI, which isn’t a massive proportion of my server’s total memory, but it’s a lot to just lose while generating a web page to display, and it does add up. Unless it’s periodically freed, I’m going to run out of memory eventually — after about 1,000 administrative page views.
So, what can I do? There are three options, none of them ideal:
Live with the delay
It’s a real possibility. The user-facing side of the site runs fine, and I’m not going to actually die for want of a few seconds lost loading a web page. It doesn’t sit well with my geeky nature though, especially since playing around with FastCGI has proved that there’s no need for the pages to be so slow.
Fix MT
I’m sure I could — eventually — track down the memory leak and remove it, and possibly even get the fix put back into the mainline of MT. The question is how long it’s going to take and how much effort it will be. Also, if the fix doesn’t find it’s way back into SixApart’s code-base them I’m stuck having to hack every upgrade release in the same way, which sounds like a nightmare to me.
Dump MT
A bit extreme perhaps, but it would avoid the problem. Everything I’ve read suggests that Wordpress (the obvious other candidate) doesn’t have performance issues. I’m reluctant to take this step now (although if I was setting up from scratch, knowing what I know now, I’d use it over MT,) simply because I have a lot invested in MT; I know how to use it, I’ve got it configured, and it lets me edit my posts in MarkDown, which my googling has suggested doesn’t work so well in Wordpress. So I don’t want to change, but if I can’t fix MT, and I can’t live with the annoyance, it might yet come to it.
Yes, I’m still alive, and yes I’m still blogging.
It’s been a bit quiet for the past few days because I’ve been sorting out some server issues. Basically, my host ran out of memory on Friday morning, and I’ve been getting it upgraded and trying to sort out some of the memory use and performance issues since then. It’s nothing particularly huge, but it’s taken all of my non-work/non-gaming time. All the software work is now done, but there’s a server migration still to happen, that’ll come up when my hosting company (the excellent RimuHosting can sort out some trouble they’re having with broken Intel BIOSs. But since that’s almost entirely managed by them, it shouldn’t take any more time out of my blogging.
While I was at it, I installed a couple of plugins for Movable Type 4, which should give quite a bit more flexibility in how you sign in while commenting. Not that anyone ever does.