Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Experimenting with a "StringList" type for simpler handling of string arrays/lists
#18
Actually, strings aren't limited. It is just a continous memory block, and it can be of any size.
I use it for sizes upto 4gb...

But they are slow, because whenever we edit the length of a string, it is copied to another location. -> Workaround is to use string buffers (which I use in my compression algorithms)
And about arrays, they are fast, but they use more data to store than strings, and are harder to manage when it comes to multi dimensional...
What about nested lists? Arrays cannot do that...

And Arrays are also slower for insertion and deletion.
But we have a workaround with strings for that too. (We can partition a string into multiple strings which will form an array -> this data structure is a Rope)
And I use Rope for my text editors, it is blazingly fast for both opening and saving files of sizes upto 200mb...

Now about my ListString: It uses sequential access, so I will make a new one which supports:
1. Lists
2. Maps (can be compared to Python Dictionaries)
3. Nested Data
This will enable us to parse JSON too.
And I will use an index map in the beginning of the list. Yes, it will make it bigger, but it will be useful for random access.
Then we can think of hash tables... Now this is a little far... Big Grin

Well, if you wanna build something, good luck.
And we are always here to help.
Reply


Messages In This Thread
RE: Experimenting with a "StringList" type for simpler handling of string arrays/lists - by aadityap0901 - 12-19-2025, 04:32 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Sub not Reconizing Dim as String pmackay 18 1,477 10-16-2025, 03:32 PM
Last Post: pmackay
  for performance, what's the best variable type to use for boolean _TRUE & _FALSE ? madscijr 12 1,260 09-29-2025, 02:59 PM
Last Post: dakra137
  Using modulo to loop through lists fistfullofnails 3 724 09-03-2025, 11:50 PM
Last Post: fistfullofnails
  Loading from file into _MEM? and LEN a TYPE... Unseen Machine 9 976 08-03-2025, 02:55 AM
Last Post: SMcNeill
  Illegal string-number conversion Herve 7 775 07-07-2025, 09:53 AM
Last Post: a740g

Forum Jump:


Users browsing this thread: 1 Guest(s)