dasDaniel / svelte-table

A svelte table implementation that allows sorting and filtering
https://dasdaniel.github.io/svelte-table/
MIT License
535 stars 40 forks source link

Using column `renderComponent` seems to be quite slow #162

Closed craigkai closed 1 year ago

craigkai commented 1 year ago

I am rendering a svelte-table:

<svelte:component this={Table} {rows} {columns} {colClickedCallback} pageSize={10} />

Where one of my column items is:

const myCustomColumn = {
        key: 'myCustomCol',
        title: 'myCustomCol',
        value: v => v.someValue,
        renderComponent: {
            component: Checkbox,
            props: {
                "callback": someCallbackFunction
            },
        },
        hideFilterHeader: true,
    };

Where my component renders a checkbox web component. When I have something like 1K rows the load time is quite sever can be around 30 seconds. Any idea if I am doing something wrong here that is resulting in the slow table rendering?

Thanks!

dasDaniel commented 1 year ago

Looks right, maybe its related to the component itself

Have a look at this example - takes about 1s to 3s for me with 5000 rows

https://svelte.dev/repl/36544acf659345bc92f085b56ad40316?version=4.2.0