list = CreateList()
The advantage when using optimized lists instead of normal Hollywood tables with functions like InsertItem(), RemoveItem(), ListItems() and GetItem() is that all those functions will be much faster.
The disadvantage is that adding or removing items may only be done via InsertItem() and RemoveItem(). You must not add or remove items from optimized lists by modifying the table directly. It's necessary to use the functions mentioned above.
To convert an existing Hollywood table to an optimized list, you can use the SetListItems() function. See SetListItems for details.
t = CreateList()
;t = {}
StartTimer(1)
For Local k = 1 To 10000
InsertItem(t, k)
Next
NPrint(ListItems(t))
NPrint("This took", GetTimer(1), "ms")
The code above creates an empty optimized list, adds 10000 items to it and
prints the time this took. Disable the first line and uncomment the second line
to see how much faster optimized lists are in comparison to normal Hollywood
tables.