[Pharo-project] SmallDictionary ?? vs RB SmallDictionary
Hi all We have no idea where SmallDictionary come from? It was not in 3.9 Especially since Set |array tally| Dictionary SmallDictionary |keys values size| and it does not seems defined as needed. RBSmallDictionary seems much better. We are currently applying traits tests to these classes and this is really interesting to see the bugs popping out. Nicolas sent a fix for capacity that I'm planning to integrate but I was wondering. Stef
I don't know. But I remember problem with Magma and Pharo when persisting MorphExtension using SmallDictionary (or SmallDictionnaryIdentity). Chris fund the optimisation of using SmallDictionnaryIdentity not really relevant. I have no opinion on that Hilaire 2009/1/13 Stéphane Ducasse <stephane.ducasse@inria.fr>:
Hi all
We have no idea where SmallDictionary come from? It was not in 3.9 Especially since
Set |array tally| Dictionary SmallDictionary |keys values size|
and it does not seems defined as needed. RBSmallDictionary seems much better.
We are currently applying traits tests to these classes and this is really interesting to see the bugs popping out.
Nicolas sent a fix for capacity that I'm planning to integrate but I was wondering.
Stef
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
We have no idea where SmallDictionary come from? It was not in 3.9 Especially since
The original SmallDictionary comes from RB. I once read some justification why this is useful for RB, but I do not remember where I found that.
and it does not seems defined as needed. RBSmallDictionary seems much better.
They both have the problem that they subclass from Dictionary and you inherit a lot of stuff that is not really necessary. As far as I know the original RBSmallDictionary was not a subclass of Collection.
We are currently applying traits tests to these classes and this is really interesting to see the bugs popping out.
Seaside has WASmallDictionary, another reincarnation of the RBSmallDictionary. We need it because we have lots of small dictionaries that we want to access fast. Furthermore the WASmallDictionary is ordered, so it remembers the order in which keys are added. This makes everything that seaside produces deterministic and therefore much easier to test (before sometimes attributes appeared in a different order in the generated html). Also WASmallDictionary makes it easy to have subclasses where the same key is defined multiple times (as for example necessary for request and response header fields). Of course we also wrote a lot of tests. Maybe you want to have a look at those? Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch
Sounds really interesting. Thanks for the pointer. I will have a look. Ideally I would like to have a good collection library and the variation you mentioned are proving that this is the way to go. Stef On Jan 13, 2009, at 10:56 AM, Lukas Renggli wrote:
We have no idea where SmallDictionary come from? It was not in 3.9 Especially since
The original SmallDictionary comes from RB. I once read some justification why this is useful for RB, but I do not remember where I found that.
and it does not seems defined as needed. RBSmallDictionary seems much better.
They both have the problem that they subclass from Dictionary and you inherit a lot of stuff that is not really necessary. As far as I know the original RBSmallDictionary was not a subclass of Collection.
We are currently applying traits tests to these classes and this is really interesting to see the bugs popping out.
Seaside has WASmallDictionary, another reincarnation of the RBSmallDictionary.
We need it because we have lots of small dictionaries that we want to access fast. Furthermore the WASmallDictionary is ordered, so it remembers the order in which keys are added. This makes everything that seaside produces deterministic and therefore much easier to test (before sometimes attributes appeared in a different order in the generated html). Also WASmallDictionary makes it easy to have subclasses where the same key is defined multiple times (as for example necessary for request and response header fields).
Of course we also wrote a lot of tests. Maybe you want to have a look at those?
Cheers, Lukas
-- Lukas Renggli http://www.lukas-renggli.ch
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
On 13.01.2009, at 09:17, Stéphane Ducasse wrote:
Hi all
We have no idea where SmallDictionary come from?
I added it. It's a renamed RBSmallDictionary... maybe this was not a good idea, but then, it's used in many place (RB, Seaside...).
It was not in 3.9 Especially since
Set |array tally| Dictionary SmallDictionary |keys values size|
and it does not seems defined as needed. RBSmallDictionary seems much better.
How? It should be the same.
We are currently applying traits tests to these classes and this is really interesting to see the bugs popping out.
Nicolas sent a fix for capacity that I'm planning to integrate but I was wondering.
Stef
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Yes this is strange, we will check that. Stef
Hi all
We have no idea where SmallDictionary come from?
I added it. It's a renamed RBSmallDictionary... maybe this was not a good idea, but then, it's used in many place (RB, Seaside...).
It was not in 3.9 Especially since
Set |array tally| Dictionary SmallDictionary |keys values size|
and it does not seems defined as needed. RBSmallDictionary seems much better.
How? It should be the same.
We are currently applying traits tests to these classes and this is really interesting to see the bugs popping out.
Nicolas sent a fix for capacity that I'm planning to integrate but I was wondering.
Stef
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
participants (4)
-
Hilaire Fernandes -
Lukas Renggli -
Marcus Denker -
Stéphane Ducasse