Maybe.
A 'file of record' with an in-memory hash or nary-tree index will get you
there in one disk access and not significantly more than 19 key comparisons.
This may be a lot better than an enormous in-memory structure and the
vagarities of the virtual memory system (unless of course, you pin it in
memory)

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Neven MacEwan
Sent: Thursday, November 01, 2001 11:00 PM
To: Multiple recipients of list delphi
Subject: Re: [DUG]: Dynamic Arrays V Strings Lists


David

Can you give more info

1/ How are you accessing  the info, by position or indexed (and how many
ways, and by what type of keys, string, integer etc)

2/ Is the data static or dynamic (ie can you stream the data in and then
sort it or is it constantly updated)

5/ Are the records fixed length

4/ What sort lookup time are you aiming at?

My gut feeling is (assuming 1 index, fixed length data)

1/ Allocate a f***ing great array of records
2/ Stream in your data using a hash function to position them in your array
3/ Lookup using a hash then linear search

You are going to require a Gig of memory anyway

HTH

Neven

----- Original Message -----
From: "David Smith" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Thursday, November 01, 2001 5:00 PM
Subject: [DUG]: Dynamic Arrays V Strings Lists


> Hi,
>
> Any one have ideas or experience if Dynamic arrays or string\object lists
is
> faster for accessing an element.
>
> Am developing an application where microns (maybe microseconds) for
> accessing an item in a list over 500 000 items (about 1500 bytes each)
based
> on an index is very important.
>
> Thanks,
> David.
>


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to