panel: Tabulator very slow with large number of columns

When you run the code below and 1) Navigate to the “Dataset” page 2) click “Load” you

  • experience a very, very slow application
import panel as pn
import pandas as pd
import numpy as np


pn.extension(sizing_mode = 'stretch_width')

df = pd.DataFrame()

ID_CreditSC_App = pn.template.BootstrapTemplate()

mainColumn = pn.Column()

df_tabulator = pn.widgets.Tabulator(df,name='Original Dataset', disabled =True, height=400, pagination='local', page_size=50)
df_tabulator1 = pn.widgets.Tabulator(df,name='Original Dataset', disabled =True, height=400, pagination='local', page_size=50)

tabs_dataset = pn.Tabs(
    (df_tabulator),
    (df_tabulator1)
)

multiSelect = pn.widgets.MultiSelect(name='Segmentation value', size=8)

btn_main    = pn.widgets.Button(name='Main')
btn_dataset = pn.widgets.Button(name='Dataset')
btn_loadSelector = pn.widgets.Button(name='Load')
btn_loadTable = pn.widgets.Button(name='Load')

def mainClick(event):
    mainColumn[:] = mainView

def datasetClick(event):
    mainColumn[:] = datasetView

def init_df():
    for i in range(100):
        df.insert(0, 'Column' + str(i), np.random.randint(0, 10, 10000))

def loadSelector(event):
    multiSelect.options = df['Column1'].values.tolist()

def loadTable(event):
    df_tabulator.value = df
    df_tabulator1.value = df



btn_main.on_click(mainClick)
btn_dataset.on_click(datasetClick)
btn_loadSelector.on_click(loadSelector)
btn_loadTable.on_click(loadTable)


mainView = [btn_loadSelector,multiSelect]
datasetView = [btn_loadTable, tabs_dataset]

init_df()

ID_CreditSC_App.sidebar.append(btn_main)
ID_CreditSC_App.sidebar.append(btn_dataset)
ID_CreditSC_App.main.append(mainColumn)
ID_CreditSC_App.servable()

Panel: 0.12.0a11

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

I’m now comfortable closing this issue after upgrading to Tabulator 5.0. The performance seems to be much improved and it’s unlikely we can do anything else on our end to improve it further.

the scrollbar does not really work: as soon as you move your mouse trying to drag the bar, the bar will move a bit and then just stay where it is, unless you go really slowly.

Also seems to work much better since the upgrade to Tabulator 5.0 in #2898.

Removing height=400 makes the tab unresponsive, chromium asks if the tab should get killed and I got one CPU that is used 100%. Firefox exhibits the same problem. There does not seem to be a memory issue though.

This will be covered by either limiting the maximum height or by enabling pagination by default if the number of rows exceeds a certain number https://github.com/holoviz/panel/issues/2841

Also I hope you don’t mind @MarcSkovMadsen but I’ve edited your posts. The errors you were seeing have already been fixed.