On May 30, 2008, at 9:50 PM, Karen wrote:
> I like to add efficient functionally to subclasses of controls for
> future use. Because I want them to be general purpose, for some uses
> speed would be most important and in others memory usage would be
> most important ... So I try to do the best I can balancing the two.
>
> Someone (i think Norm) talked about how they implemented a ListBox
> RowTag by using a dictionary (or two?), overriding the
> ListBox.CellTag getter and setter and adding RowTag getter and
> setters with the Dictionary key being being stored in the CellTag for
> column 0.
>
> In the past I did the same sort of thing by creating an object with
> two variant properties (one for RowTag and one for CellTag) and
> storing that in the CellTag for column 0. But after see the above
> approach, it occurred to me that the memory overhead for object
> creation would likely be significantly higher for the object approach
> for PERHAPS a negligible increase in access speed. So I thought the
> dictionary approach was probably superior...
>
> But these days variants can store arrays so I thought why not store a
> two element variant array in the CellTag for column 0 instead of
> using a dictionary or an object. That MIGHT both be faster and more
> memory efficient that either of the above solutions... What do you
> think? What type of situation would this be better or worst for?
>
> But don't tell me I should not worry about it! ;)
This would be a good place to use Pair objects.
Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|