Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


StringList: max size ?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
paul44
Expert Cheater
Reputation: 2

Joined: 20 Jul 2017
Posts: 122

PostPosted: Wed Nov 17, 2021 9:51 am    Post subject: StringList: max size ? Reply with quote

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 ? Wink)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 422

Joined: 09 May 2003
Posts: 24042
Location: The netherlands

PostPosted: Wed Nov 17, 2021 10:54 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
paul44
Expert Cheater
Reputation: 2

Joined: 20 Jul 2017
Posts: 122

PostPosted: Thu Nov 18, 2021 1:05 pm    Post subject: begin/endUpdate() Reply with quote

Before anything, i still would like to know 'max size'...? so if anyone happens to know this (or can reference), please do.
(i do not think it will be an issue for my design though; whatever the limit i'm pretty sure it will never reach it)


^ That said: did a quick search on the begin/endupdate methods:
a. it will speed up as listbox update is "minimized": [ https://www.cheatengine.org/forum/viewtopic.php?t=603468&sid=97b830cc86b33c8902d914e7e5d1f8fe ]
b. however, these functions can also be used on (f.e.) the stringlist object: [ https://cheatengine.org/forum/viewtopic.php?t=614463&start=0&postdays=0&postorder=asc&highlight=&sid=9a8535094e589ccb6332ef3c3ff2d1bb ]

Frankly: i buy the first approach any day, but not so sure about the 2nd one (added_value-wise, i mean) ?! Anyways: added it to my script for completeness sake.

To explain where i came from: [ https://www.dropbox.com/s/8t58i7euobeln8p/ACVH_Special%20List_Listbox.png?dl=0 ]
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 422

Joined: 09 May 2003
Posts: 24042
Location: The netherlands

PostPosted: Thu Nov 18, 2021 1:49 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites