godilite / editable

This library allows you to create editable tables and spreadsheets with ease, either by providing initial row and column count to display an empty table or use it with predefined rows and column data sets.
MIT License
104 stars 36 forks source link

Performance issues #30

Closed Uni2K closed 3 years ago

Uni2K commented 3 years ago

I tried to use this library to display some basic data from a database. There were around 8 columns and a maximum of around 100 rows.

The problem is that its not possible to use the "table" with more than around 5 rows. Whenever scrolling is necessary, everything just becomes extremely laggy. It uses such high amounts of CPU that some devices/browsers even show a performance impact message. Scrolling is not even possible when the number of rows is >50, it then runs with <1FPS.

I looked at the code and found 2 mayor problems:

  1. The rows are wrapped in a "Column" widget. This is super inefficient. I replaced it with a Listview.builder and got a huge performance increase.
  2. The textinputfields in every cell are somehow pretty hard to render. Replacing them with standard text widgets leads to a massive gain in performance. However, the edit functionality is lost, which is why I transformed the "save" button into a "popupmenubutton" and introduced the options edit/delete.

Combining both points, everything works smooth like it should. Since point 2 is somewhat a conceptional change, I would at least recommend point 1.

timmaffett commented 3 years ago

You should consider forking the repository and making your changes available for others