Gloda questions/suggestions.

Blake Winton bwinton at latte.ca
Mon Jun 14 17:15:45 UTC 2010


I've been using Gloda to do most of the heavy back-end lifting in the 
HomeTab, and I've run into some places where I would like to see things 
changed/improved.

The main problem I'm running into is that it takes a long time to 
display the conversations in a folder.  Here is some timing data I've 
collected, in an effort to determine what was slow:

The first number is the time it takes for the Gloda query to finish. 
The second number is the time it takes for us to post-process the 
messages from gloda and display them.
* Home/Inbox - 8 msgs - 117/46
* Archive/2010 - 383 msgs - 2282/209
* Work/Mozilla - 729 msgs - 3253/220
* GMail/Inbox - 5628 msgs - 8584/219

So, the vast majority of time is being spent in the gloda query.  (And 
the constant post-processing time makes sense, since we limit the number 
of messages to 50, as seen below.)

For reference, the query is:
    let query = Gloda.newQuery(Gloda.NOUN_MESSAGE);
    if (aFolder.flags & Ci.nsMsgFolderFlags.Virtual) {
       let vFolder = new VirtualFolderHelper.wrapVirtualFolder(aFolder)
       query.folder.apply(query, vFolder.searchFolders);
     }
     else {
       query.folder(aFolder);
     }
     query.orderBy("-date");
     query.limit(50);

DavidA let me know that we aren't indexing on date, so this query will 
run slower than it might otherwise, and hopefully that can be fixed 
fairly easily.

If there was a way for me to more easily get the conversations for a 
folder, then I wouldn't have to go through each message, and collect 
that data myself.  On the other hand, that doesn't seem to be the slow 
part of this, so perhaps it's not worth it.

The other idea I had (and I don't know if it's technically feasible), 
was for partial updates to be sent through onItemsAdded, before the 
first query is finished. Currently, I get a long pause, followed by a 
single call to onItemsAdded, and then immediately afterwards, a call to 
onQueryCompleted.  If I could get the data fed to me sooner, piece by 
piece, I believe that would give the user the impression of us being 
faster than we are.

And in a related suggestion, some way of paging through the results 
would let me load fewer initially, and then add more later.

(If there are bugs for these already, please let me know what they are, 
or cc me on them.)

Thanks,
Blake.




More information about the tb-planning mailing list