Re: Generic collections vs. arrays on structs vs. class



Hi buu,
may be this article help for you:
http://blogs.msdn.com/ricom/archive/2006/03/09/548097.aspx

On Dec 14, 3:32 am, "buu" <a...@xxxxx> wrote:
I started working on a performance demanding app. I created structures that
I put into an Array. Then I realized that arrays are byref objects, while
struct is byval.
Now, I presumed, that managing these objects would be faster if I would use
class instead of structure, cause I can send a reference, not the whole
object as an procedure parameter. Am I right?

but.... I realized that it would be very good to use generic collections
instead of array (that keeps classes). Would it be faster than structs on
arrays? (or even classes put in arrays).

Also, wich kind of generic collections would be the best for it?
These objects have one primary key (because of it Dictionary is one
possibility), but that object has 2-3 index keys wich are often used, but
they're not unique.
Wich way you recomend?

.



Relevant Pages

  • Re: How to get address of a Java object?
    ... * here to provide for proper alignment of int. ... An array of 1000 such structs might waste 3KB. ... Each "struct" was then retrieved by a single index that ... related locations in the multiple arrays. ...
    (comp.lang.java.programmer)
  • Re: strucutre outputs
    ... char *array_one = { ... You are only looping through the arrays. ... This string tells fprintf that the next N arguments will have type ... You started out saying you had an array of struct. ...
    (comp.lang.c.moderated)
  • Re: [PATCH 2/5] dma_map_sg_ring() helper
    ... a ring of scatterlist arrays. ... This patch introduces 'struct sg_ring', a layer on top of scatterlist ... * This provides a convenient encapsulation of one or more scatter gather ...
    (Linux-Kernel)
  • Re: Malloc - C program
    ... how many arrays are needed. ... void pointer in the global scope and then have my initialization ... then your top level pointer should be of type ... argument for using struct Tn**, choosing any of the structure types ...
    (microsoft.public.vc.language)
  • Re: structure toupperlower?
    ... >> How can I use a for loop on a struct? ... > of which contains offset and size information for the struct members ... > The toupperand tolowerfunctions apply to a single character: ... > If you have a struct some of whose members are character arrays ...
    (comp.lang.c)

Loading