Robbat2 (robbat2) wrote in lj_dev,
Robbat2
robbat2
lj_dev

CSS-Cleaner complaint #1 - 150% worse page performance

Introduction:

My custom S1 style (created long before the dawn of S2) uses external stylesheets of my own magic. 7 of them to be exact. Since the introduction of CSS-Cleaner, the pages load noticably slower, even when refreshed immediately (so that the styles should be coming from the hot cache at LJ). My pages used to load in 1 second, but now I'm lucky to get them in 3 seconds.

I'll make a second post with the other thing (more major) item that CSS-Cleaner has broken with my stylesheets.

Testcase #1:
  1. I set up FasterFox with the default Firefox settings, but it's display timer enabled, so I could see load times.
  2. Load my page http://robbat2.livejournal.com/calendar multiples time, determine average - 2.8 seconds over 15 runs.
  3. Edit the style to leave out all stylesheet <link> tags except one.
  4. Repeat #2, time is now 1.2 seconds over 15 runs.
  5. Notice a 1.6 second difference between the setups.
  6. Remember to set the style back the way it was originally.
Now for testcase #2, we must exclude the browser's load time of stylesheets from affecting the result.
  1. Load http://robbat2.livejournal.com/calendar, save a local copy to /tmp/calender.remote.html
  2. Produce a copy that goes direct instead of using CSS-Cleaner:
    sed -e 's,http://cssproxy.livejournal.com/?u=,,g' </tmp/calender.remote.html >/tmp/calender.local.html
  3. Load file:///tmp/calender.remote.html 15 times, average is 1.9 seconds.
  4. Load file:///tmp/calender.local.html 15 times, average is 0.5 seconds.
  5. Notice the difference is 1.4 seconds between the setups.

I think the correlation between the 1.6 and 1.4 seconds is too much of a co-incidence. CSS-Cleaner is badly slowing down my pages. If we assume 1.5 seconds is the slowdown caused by CSS-Cleaner, and that my pages used to load in 1 second (tolerance of 0.1 seconds), then we can say that CSS-Cleaner is inducing a slowdown of 150% - taking 2.5 seconds instead of 1 second.

I checked in my access_log to see if the 5 minute caching alluded to a previous post was correct, and it does seem to be reasonable true, to within 10 seconds of the 5 minute mark.

I haven't looked at the CSS-Cleaner codebase as of yet, but I'm wondering if anybody here has suggestions on the slowdown, other than reducing the number of stylesheets I use, which isn't really an option (see my next post).

Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 4 comments