[celeste] moving from Communicator to Celeste....

Joshua 'Schwa' Gargus schwa at cc.gatech.edu
Sun Nov 4 14:25:14 UTC 2001


(shrug) It's much better than the status quo, and it's already been done
without too much effort.

I only had about 1000 messages, but I don't remember it taking 12
seconds to gather up the IDs.  Hmmm...

This could be the problem.  The #fieldNamed:ifAbsent: method you use
didn't exist until this February, and therefore I wasn't doing things
that way.  I had added an instance variable 'uidl' to mail message;
this avoids both a Dictionary lookup as well as a send of
#asLowercase.  Just for kicks, how long does it take for you to run:

[mailDB allMessages do: [ :id |
	(mailDB getMessage: id) fields]] timeToRun

This would be approximately how long my scheme took (substituting the
message #uidl for #fields).

Of course, MailMessage looks much cleaner nowadays, without the
separate variables for to:, from:, etc.  I wouldn't want to start
adding new variables all over the place.

I suspect that the big slowdown might be the use of Strings as keys;
this requires both the #asLowercase as well a character-by-character
comparison to check if keys match.  A compromise might be to use
Symbols.  When a message is first read in, the keys to fields could be
created by:

fieldString asLowercase asSymbol

and then accessed by:

fields at: aSymbol


I don't have a Celeste mail database right now, so I can't play around
with this myself.  I'd be interested to hear what turns up, though.

Joshua



On Sat, Nov 03, 2001 at 09:51:35PM -0500, Lex Spoon wrote:
> 
> "Joshua 'Schwa' Gargus" <schwa at cc.gatech.edu> wrote:
> > A long time ago (in Squeak time) I hacked something up that just downloaded
> > message IDs, compared them to the messages Celeste already had, and only 
> > downloaded ones it hadn't seen.  I updated it a couple of times, but can't
> > seem to find the code.  The most recent version I can find is on Bert's
> > swiki:
> > http://swiki.gsug.org:8080/sqfixes/90.html
> > 
> > The changeset was for Squeak 2.4, so I imagine it will break stuff
> > (especially with all the work that has been going into Celeste lately).
> > However, it shouldn't be too hard to bring up to date, if anyone's game.
> > 
> 
> 
> How does it scale, though?  Reading in all message-id's in the database
> will probably take a little while....  Let's see:
> 
> [ mailDB allMessages do: [ :id |
> 	(mailDB getMessage: id) fieldNamed: 'message-id'  ifAbsent: []] ]
> timeToRun
> 
>   ==> 222285  
> 
> So about 3.7 minutes for 20k messages.  Maybe it's worth putting in
> there even as it is, just so that people can play with it, but it would
> sure be nice if the info was stored in the index file for speed!
> 
> 
> -Lex
> 




More information about the Squeak-dev mailing list