View previous topic :: View next topic |
Author |
Message |
paul44 Expert Cheater Reputation: 2
Joined: 20 Jul 2017 Posts: 152
|
Posted: Wed Nov 17, 2021 9:51 am Post subject: StringList: max size ? |
|
|
Does following also applies to CE (~ Lua) ?: [ https://edn.embarcadero.com/article/30333 ]
And if not, what is the actual limit?
Reason: i'm currently managing a large list via a Listbox (2500+ items). But if i use 'f.ListBox.Items.add(str)', then it can take a "long" time (15-20s) to complete the script (and fill the listbox)
Since I also had experimented with saving that list to disk - being pretty instant (2-3s) - i eventually figured i could "pre-build" the list in memory (using said stringlist), and then just feed the Listbox once. Time to show the completed listbox is now around 3-4s max !
fyi: the max size of a lua string is around 250k characters (at least according to stackoverflow); i limit that to 200000 prior to writing to disk btw.
ps: the article mentioned above can be problematic to open, so:
--[[
TStringList can hold up to 134,217,728 strings (MaxListSize+1). There are no limits on the size of the string (other than physical memory limits and processor address space limits).
]]--
(^ anyone willing to give THAT a try ? )
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Wed Nov 17, 2021 10:54 am Post subject: |
|
|
Don't forget to use beginUpdate/endUpdate to speed it up
alternatively, use a listview with 1 column and use ownerdata
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
paul44 Expert Cheater Reputation: 2
Joined: 20 Jul 2017 Posts: 152
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Thu Nov 18, 2021 1:49 pm Post subject: |
|
|
not sure about the max, but if you are going to end up using 200000 or more entries, i really recommend using a listview or use a thread and use a synchronize block of 10 at a time. (look at .net info which does something similar)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
|