Open multimeric opened 1 year ago
I note that "Lazy loading API" for DataTable is listed in the Roadmap. I might be able to give implementation a go if one of the maintainers is interested.
Anyone come up with an implementation/workaround for this? Very interested as well
Could this be used as an interim solution? https://github.com/tconbeer/textual-fastdatatable
The
DataTable
seems to have performance issues with about a million cells. If we reduce the number of cells in memory at one time to a fraction of that, and then lazily load new rows as the user scrolls down, plus delete old rows, it seems like we might solve these performance issues. Not entirely sure though because I'm not sure how the implementation works.The simplest implementation of this might be via a pagination mechanism where the user has to implement
get_chunk() -> Iterable[Row]
and the class handles the loading as the user approaches the end of the current chunk . This would also support viewing external data such as in a database or a remote API and avoid having to load everything into memory.