Skip to content

Virtual table improvements/fixes #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 19, 2018

Conversation

DanTup
Copy link
Contributor

@DanTup DanTup commented Sep 18, 2018

  • Fixes a bug when showing the table when rows = null
  • Stops cloning the list passed to 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)
  • Removes duplicated code that resulted in double-logging (I think I messed this up in a merge/rebase with conflicts - the code was supposed to be moved)
  • Update comments above perf of _log and remove TODOs

The 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.

This isn't ideal, but it is a big performance win if the list is big. Since we don't make assumptions about the data outside of the rebuild method I think it's pretty safe.
Possibly I merged/rebased badly - this code was originally moved, but we've ended up with two copies. This meant every event was being logged twice.
@DanTup DanTup requested a review from devoncarew September 18, 2018 10:43
@DanTup
Copy link
Contributor Author

DanTup commented Sep 18, 2018

Downloadingquiver 2.0.0+1...
Could not find a file named "pubspec.yaml" in "/home/travis/.pub-cache/hosted/pub.dartlang.org/pool-1.3.6".
The command "pub get" failed and exited with 66 during .
Your build has been stopped.

Hmmmm 🤔

// of items from the old data. This is faster than insert(0, log).
//
// If this turns out to be too slow, we can make it faster (saving around
// 30-40% of the time) by just .add()ing to the list and having a flag on
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems worth doing - appending to the list and reversing the way we index through it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okey, I'll do in a separate PR 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants