You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That is a "feature" of the implementation of the array part of a table. It uses the erlang array module which has not fast way of stepping to the next index which has a value. You basically have to test each value. It could be done more efficiently by explicitly working with the internal representation.
An alternative would be to use the same type of tree for the array part of a table as for the rest. It does a next call but it is generally slower than using arrays.
I will test maps when they can handle larger numbers of elements, but they don't have a call to get the next index.
I am sure of the best way to express it. It is not a problem of having a large table or large indexes per se. It is really a problem with pairs in that when pairs goes from one integer key to the next it has to literally loop over each key until it gets to one which has been set. Or rather the internal representation of this part of a table does not properly support this type of operation.
Try this:
It takes a long time, while in vanilla lua such construction runs instantly.
The text was updated successfully, but these errors were encountered: