Re: Generic collections vs. arrays on structs vs. class
- From: "Nip" <admin@xxxxxxxxxxxxx>
- Date: Mon, 29 Jan 2007 18:26:01 +0100
Hi
I have lately written an app to measure exactly this.
I came to the result, that an array of classes is the fastest, but structs are much less memory consuming.
About the idea of generic collections: their performance is extremely bad (i got a 4x better performance with arrays).
--
Yours,
Lukas Cavigelli
http://www.cavigelli.net
"buu" <aha@xxxxx> schrieb im Newsbeitrag news:elpl4j$s9b$1@xxxxxxxxxxxxxxxx
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?
.
- Follow-Ups:
- Prev by Date: Re: IDE freezes during startup
- Next by Date: Re: Generic collections vs. arrays on structs vs. class
- Previous by thread: IDE freezes during startup
- Next by thread: Re: Generic collections vs. arrays on structs vs. class
- Index(es):
Relevant Pages
|
Loading