bosskmk / pluto_grid

PlutoGrid is a dataGrid for flutter that can be controlled by the keyboard on desktop and web. Of course, it works well on Android and IOS.
https://pluto.weblaze.dev
MIT License
635 stars 288 forks source link

how optimize for a huge number of records #1075

Open Haugpro opened 1 week ago

Haugpro commented 1 week ago

Hi, I need to scroll vertically through a list of at least 10 MIO records parsed from LOG-file that's stored on a local disk. I do not need to edit the records and I do not need any calculations done by the grid.

Since with PlutoGrid I have to create a list of PlutoRows containing the data of all 10 MIO records already fully parsed from the LOG-file in advance and add it to the rows property of PlutoGrid, it takes (many) minutes until the grid shows up.

I did my first tests with 'ListView.builder' : instead of a ready list of records, I could assign a value for the 'itemCount' and a function for the 'itemBuilder' property that returns the content of a row for a given index. This way I could start much faster with a simple parsing that only separates the opaque records from the LOG-file and keeps a list of offsets for each records start position. The record content is only parsed, when the ListView.builder calls the itemBuilder function. This way the ListView is displayed instantly and fast scrolling works smoothly anyway. Of course this only works fast when rowHeight is set to a fix value, which is no problem in may case.

Is there a similar way with PlutoGrid to supply only the number of rows and a function that returns a rows content for a given index? I am aware that this would block some PlutoGrid features.

Thank you very much