First, I'm very excited about this release!

Yay!

On Wed, 7 Jun 2000, Mark Guzdial wrote:

> Some questions on your enhancements page:
>
> - "Use instance variables in blocks" -- what does this mean?  Do you 
> mean block locals?

I was curious too. If you *do* mean block locals, remember that they
aren't *really* local to the block, nor are they reentrant.

At least, as I recall. I can't seem to get them to compile at the moment
:)

> - "Pages are OrderedCollection: pages was a dictionary of in-sequence 
> numbers pointing at pages. Changing that to a collection is more 
> elegant."  How so?  Dictionaries are much faster for finding 
> individual elements, no?

Er..elegance vs. speed?

The elegance comes from using the indices as the page index, rather than
simulating them with assocations of the form 1->aSwikiPage.

I don't recall what access times are for OrderedCollections. Since, an
OrderCollection is really a wrapper around an array (an not a linked
list) access times should be constant, though a *little* slower than a
straight array due to index calcuation.

But Dictionaries accessing fuctions are a bit more complex. It's not
*just* a hash (and if the hash is muffed, it coudl be slower). Also,
dealing with a set of associations is fairly slow, IIRC. That's why
IdentityDictionarys are preferred for speed (identity dics use two
parallel arrays, one of keys, one of values; if you're using smallintegers
as your keys...as he was...and an IdentityDictionary...which he should
have been ;)...then this is going to be somewhat slower than a straight
array on index lookup without any benefits that I can see).

Now reverse lookups may be a different matter. (I.e., matching the
"value"). Hmm. Identity dictionarys look to win big there.

So, if you need to get the number from the object, an IdentityDictionary
is probably ....

Oops. Well, #indexOf: will probably be similar to
Dictionary>>keyAtValue: and slower than IdentityDictionary>>keyAtValue:.

But if you store the id in the object, it'll be fastest of all :)

<sigh/>Jumping around in the Collection heirarchy is so much fun!

(Yes, that *was* a sigh of pleasure.)

Cheers,
Bijan.

Reply via email to