[Lazarus] TStringList alternatives?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] TStringList alternatives?

John Landmesser-3
i use TStringList  to store about 100.000 values.

That's ok, but i would like to know if there are better ways to do that?

I have Values from a Oracle Database with Row-Id's like
2016070502523396 HTCSFVRY

My StringList is sorted, to do a quick IndexOf()

I would need  add and IndexOf()

What about VirtualTree? TList ... ?

advices are welcome :-))


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TStringList alternatives?

Xiangrong Fang
Have a look at my generic TVector implementation, written from scratch, based on dynamic array:


Regards.



On Thu, Aug 4, 2016 at 9:15 PM, Landmesser John <[hidden email]> wrote:
i use TStringListĀ  to store about 100.000 values.

That's ok, but i would like to know if there are better ways to do that?

I have Values from a Oracle Database with Row-Id's like
2016070502523396 HTCSFVRY

My StringList is sorted, to do a quick IndexOf()

I would needĀ  add and IndexOf()

What about VirtualTree? TList ... ?

advices are welcome :-))


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TStringList alternatives?

Denis Kozlov
In reply to this post by John Landmesser-3
On 04/08/2016 14:15, Landmesser John wrote:
> i use TStringList  to store about 100.000 values.
>
> That's ok, but i would like to know if there are better ways to do that?

You can try TFPStringHashTable and TDictionary/THashMap generics. Maybe
they will perform faster than TStringList.

Denis
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TStringList alternatives?

leledumbo
Administrator
In reply to this post by John Landmesser-3
> I would need  add and IndexOf()

Fast insertion, fast retrieval, definitely a hash table / map. Follow Denis suggestion. I personally prefers fcl-stl's ghashmap (THashmap), but any other similar classes will do.