Speed issues

April 1, 2008
By Mike

I’ve had a number of people complaining about speed issues. Firstly there was Michael who left the following comment (There are a few other comments from Michael as well): -

First, I must thank you for your wonderful work. I’ve used Wizz for a while now and find it quite useful.

In the interest of providing you with feedback, I thought I would share my experience. I’m am noticing a significant performance hit when running Wizz as compared to my previous experience on FF 2.0. I’m not sure if the problem is a FF problem or a Wizz problem. I’m also seeing problems with read headlines re-appearing as unread.

I am running 2.9.4 (your latest update from this page) on FF 3B4 on XP. I am using FF portable installed on my hard drive, not a USB key so I don’t expect a performance hit.

Unfortunately, I can’t give you a direct comparison between 2.9.4 and the FF 2 version since I can’t run both programs simultaneously. Even though FF2 and FF3 run off of different profiles, if I start FF 2 I see Wizz 2.9.4. I must admit I’m not sure how this works.

When I open Wizz in FF3 it seems to take a while to load up the list of feed categories (I have four folders/categories with four to six feeds each). While it is loading it locks me out from doing other stuff. I’m not sure if it is actually slower or if it is that I’m locked out while its setting up.

Clicking on a feed category then takes too long to load. I also have it set to only show unread headlines. I consistently have it showing feeds that I have already read. Sometimes it seems to show me the entire set of headlines as unread. Other times it skips most of the read headlines; however, there are a few stubborn headlines that will not stay read.

And then mj left the following comment: -

first off, thank you for the effort to make Wizz RSS available for firefox 3 beta.

I have been using Wizz RSS for a long time and was very satisfied. Now, I switched to firefox 3 and the Wizz RSS 2.94. I found it became much slower when I selected a feed. It would take about 7 seconds to just show the feed while in firefox 2 it was almost instant (I compared side-by-side with the same feed in both versions). During that 7 seconds, I noticed the HD LED is blinking heavily.

Can you look into this and try to get some improvment? 7 seconds (for a feed that only has 10 items) is just very annoying.

Again, thanks for your great work.

At this point in time I have absolutely no idea what is causing the problem. There was a bug in 2.9.3 that was causing huge amounts of data to be collected in the SQLite database, which was causing everything to get really slow. The bug is documented here – http://wizzrss.blat.co.za/2008/03/12/html-sanitization-bug/ and here – http://wizzrss.blat.co.za/2008/03/13/html-sanitization-bugfix/

The bug has been fixed and a quickfix for cleaning all the rubbish out of the database was posted here – http://wizzrss.blat.co.za/2008/03/14/getting-rid-of-item-description-accumulations/

But still it seems that some people are having speed problems.

I suspect that the problem is somehow related to SQLite: Maybe I haven’t indexed the data correctly?

Anyway, I have been trying to get to the bottom of the problem, but so far I’ve been unable to replicate it. I have tried on two different PCs, both of which are running Windows XP. On both PCs I have cranked the database size up to over 5Mb (Which is tiny for what SQLite can handle). I have been reading feeds, opening and closing Firefox, running multiple instances of Firefox, reading categories which contain 20 to 30 feeds each, and even running the Watch List while I simultaneously read other feeds, and I’ve not had one single hiccup… Yet.

Yes I’ve seen a few slow responses, but even after a slow response I get sub-second responses from servers in South Africa. I have also made sure that responses are not being read from local cache.

So what’s causing the problem?

I have no idea, but if any of you can provide and insight that might help getting to the bottom of the problem, I’d really appreciate it.

9 Responses to Speed issues

  1. mj on April 1, 2008 at 7:30 pm

    I believed the slowness is introduced by those database access with small transactions.

    I was able to speed things up and gain 4 seconds (now it’s 3 seconds down from 7 seconds) if beginTransaction() is added to your code in handeresult in itemreader.js. (and commitTransaction() at the end).

    I also think by using a precompiled statement (store procedure) and/or caching control it will speed up even more.

    Hope this would help.

  2. Mike on April 1, 2008 at 8:03 pm

    Thanks mj! Thanks for the input! It’s a real help and I appreciate it!

    Cutting the time by more than 50% is hugely significant, but 3 seconds is still very slow.

    I’ve now pushed the size of my wizzrss.sqlite file to over 114Mb. I haven’t made any code changes and I’m still seeing sub-second times.

    But I plan to follow your advice :)

    Over the weekend (Or as soon as I get some time) I’m going to dissect every line of code that talks to the database. I wasn’t aware that SQLite could use precompiled statements, but that makes a HUGE lot of sense.

    Thanks again!

  3. Michael on April 3, 2008 at 12:19 am

    Hello, its Michael again.

    I can’t offer any useful comments the way that mj did, but I do have an idea. I would be willing to run a debug version of your code on my computer so you could pinpoint the areas of delay.

    I’m sure you’ve done this before, but the way that I’ve seen it is to create a timestamp function that takes a description and records a timestamp and the description to an external log file. Throughout your program you call the timestamp function like this:
    timestamp(‘Before item list is read’);
    timestamp(‘After item list is read’);
    By comparing consecutive entries in the log you can determine the parts of the program where the longest execution time is occuring.

    I don’t mean to insult you by describing such a simple process. Since we are working across time zones, communications can be delayed, so I’m just trying to be as complete as possible.

    Anyway, if you develop a debug version of your code, I would be happy to install it and send you the log file so you could pinpoint the problem.

    Once again, I must add that I am impressed with your work. I’m so willing to help and so tenacious because you have a product I want to use.

    Michael

  4. Mike on April 3, 2008 at 9:41 pm

    Sorry guys. It’s been a bit of a hectic day today :)

    My plan: I’d like to get Wizz RSS working on Firefox 3.0b5 tomorrow. I’d also like to devote as much of the weekend as possible, to getting these SQLite issues sorted out.

  5. Dev on April 6, 2008 at 1:26 pm

    Hello,
    When do you plan to get Wizz RSS working on f3.0b5 ?

    Regards

  6. Mike on April 6, 2008 at 7:04 pm

    @Dev – My father is busy dying from cancer. This weekend is possibly the last time that I have to spend with him. I planned to work on Wizz RSS over this weekend, but unfortunately Wizz RSS comes a very distant second when it comes to my family matters.

  7. Michael on April 6, 2008 at 7:56 pm

    Ouch, I’m sorry to hear about your father.

    I don’t know if he understands the scope of the work you’ve done through Wizz. Any news reader makes it easy to collect headlines, but one ‘minor’ feature really elevates its capabilities: Wizz can load an entire category of feeds by clicking on a folder of feeds.

    With categories, I can create my own custom ‘newspaper’ that allows me to compare sources and viewpoints across the world. Information access is the lifeblood of a free society. Wizz makes me a better informed global citizen. Of course, it also allows me to escape for a few moments with my ‘fun feeds’ category [grin].

    I see that Wizz has been downloaded over 8,000 times which means that there are thousands of stories across the world similar to mine. Anyway, I wanted to let you know how worthwhile I find your work.

    I am sure that your father has accomplished many meaningful things in his life, but this is the only one I can comment on. His role in raising you has left a legacy that touches thousands of people throughout the world.

  8. Mike on April 7, 2008 at 3:09 am

    My thoughts are with you, Mike.

    I lost my oldest sister and her
    husband last year (a year apart).

    And both my parents are deceased.

    I know what it was like for me.
    (painful)

    I can’t begin to put myself in your
    shoes.

    Take care.

  9. Mike on April 7, 2008 at 6:54 am

    Thanks guys.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*