realbasic-nug
[Top] [All Lists]

Re: Efficient Lisbox RowTag Implementation

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Efficient Lisbox RowTag Implementation
From: Charles Yeomans <charles at declareSub dot com>
Date: Sat, 31 May 2008 10:57:24 -0400
Authentication-results: mx.google.com; spf=pass (google.com: domain of realbasic-nug-bounces at lists dot realsoftware dot com designates 66.116.103.65 as permitted sender) smtp dot mail=realbasic-nug-bounces at lists dot realsoftware dot com
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <1F5D7379-4B88-4ABE-81F8-064A4F575B16 at verizon dot net>
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>


<Prev in Thread] Current Thread [Next in Thread>