Virtual table improvements/fixes #11
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
setRows
in tables (this isn't ideal, but for big tables just copying the list can take a long time - I think the risk is low and if a consumer of the table wants, it can provide a cloned list to setRows)_log
and remove TODOsThe last one - I had previously mentioned adding a small buffer, but it turned out to be slightly complicated and I came up with a better idea - just reusing the same list and appending using
.add()
- this gets fast because the table capacity doubles so once the table gets big (or near its max size). The downside is that logs are added to the bottom - but we can easily fix that with a flag on the table that just reverses the index as it reads data.That said, it's performing well enough locally that I didn't think it was worth that complexity. If you feel that we do need to make it faster, I think this should be the first thing to try - just lmk.