Re: Set / List

From: Robert Olofsson (d94-rol_at_tjatte.nada.kth.se)
Date: 10/18/03


Date: 18 Oct 2003 09:08:53 GMT

Chris Smith (cdsmith@twu.net) wrote:
: That's exactly it. The Collections API is very concerned with the order
: of complexity assigned to various operations. Using hashing as the
: store for a Set makes it much faster to check...

: What advantage do you see for using a List?

Less memory use. A hash has an array where it stores Entries,
Each entry has at least two references. A list only has the array
with references to the values.

If memory is the problem it is easy to write a ListSet that uses a
list as a backend. I would think that speed is preferd for nearly all
applications though.

/robo



Relevant Pages

  • Re: Reclaiming Memory
    ... example, handles to device context, memory addresses, etc.), VB is actually ... VB will clean up references to objects all ... It's a little unusual to use an array to store object references. ... unusual to use a variant array for what you apparently are (at least I'VE ...
    (microsoft.public.vb.com)
  • Re: Array.Resize question
    ... Only if there are no other references to those objects, ... objects that are now thown out of the array released properly by the CLI?" ... Garbage Collection only occurs when the system is low on memory. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: There is no sizeof in a managed language, right?
    ... I was trying to find how much memory is taken up by an array of ints, ... With references and managed languages, what do you use to figure this ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Will memory get over-used?
    ... or have a poor memory.. ... still has array maximum sizes limited to 2GB" ... array will be that of a bunch of references, ... Arrays are not the same as objects and ArrayLISTs ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Fast string operations
    ... Looping: I thought looping over arrays in managed code was "slow" ... array handling and such. ... The problem with TrimHelper is that it always returns a new string instance. ... The customer perceives this as a memory leak. ...
    (microsoft.public.dotnet.languages.csharp)