[e-lang] TraversalKey bug fixed; Equalizer questions
Kevin Reid
kpreid at mac.com
Sat Apr 14 16:43:30 CDT 2007
On Apr 14, 2007, at 16:51, Mark S. Miller wrote:
> Kevin Reid wrote:
>> 3. When comparing two references, the current code keeps a stack of
>> containing objects which are currently being compared, to allow
>> comparing cycles. Would it be incorrect (ignoring efficiency for the
>> moment) to remember all such pairs through an entire comparison,
>> rather than forgetting them as sub-comparisons finish?
>
> Yes, either algorithm is correct.
One might imagine this would make comparison more efficient, but it
would result in much more storage being used, since it would build a
flattened copy of the structures being compared; furthermore, there
would be more references to search through for another pair.
One could use a pair of hash tables to keep the pairs, which would
eliminate the linear search; I don't have a guess what the
performance difference would be. (Has using hash tables been tried by
itself with the current implementation?)
However, the pointer-replacement idea (#4), if implemented, would
provide all the benefits of keeping pairs without the disadvantages.
--
Kevin Reid <http://homepage.mac.com/kpreid/>
More information about the e-lang
mailing list