Resources performance in gantt

Hello,
We start using resources in gantt, but for larger projects it performance is very poor. Event after the data loaded, scroll is lagging and not working as smooth as in gantt chart.
As you can see on screen, my scroll is on bottom bot resources diagram is not scrolling.
ezgif.com-gif-maker

FYI: We use custom cell template for resources.

Hello Wolland,
I tried to reproduce that issue in the official sample, but in my case, it works correctly:
https://docs.dhtmlx.com/gantt/samples/08_api/10_performance_tweaks.html
https://files.dhtmlx.com/30d/e700138cd1c6471c171329525a57a616/vokoscreen-2022-11-08_20-36-45.mp4

It can help you if you enable the static_background config.

If you can reproduce the issue in the sample, please send me a screenshot with the parameters you used.
If you cannot reproduce it there, most likely, the issue is related to the Gantt configuration, but it is hard to suggest what might be wrong as I don’t se your code.
In that case, please add your configuration to the following snippet and make sure that the issue is reproduced there:

Then, click on the Save button and send me the link.
Or send me a ready demo with all the necessary JavaScript and CSS files so that I can reproduce the issue locally.

Hi! We have the same problem and I was able to replicate the issue using the https://docs.dhtmlx.com/gantt/samples/08_api/10_performance_tweaks.html
website.

The following settings can reproduce the problem:

Tasks: 20000
Res. per task (max): 4
Build links: checked
Resources: checked

Selecting “Task 4” after the Gantt has loaded takes a few seconds. Selecting “Task 15” next takes another couple of seconds until the selection is visible. Scrolling is delayed by a few seconds after a task is selected.

I made the following observation - if “Res. per task (max)” is set to “1”, the Gantt works much better. There is still a short delay after selecting a task, but it’s not several seconds.

Hello Coman,
Thank you for letting us know about that issue.
I added it as a bug to our internal bug tracker. The dev team will fix it in the future, but I cannot give you any ETA.

The issue should occur when the fetchTasks option is enabled. You can check that in the following snippet:
https://snippet.dhtmlx.com/613eyhai

Even if you try to check all items in the assignment datastore, it will take some time because there are many items there:

gantt.getDatastore("resourceAssignments").pull

Hello Ramil,

Thanks for the quick reply. Just a heads up: we tried setting settings fetchTasks to false in the datastore, but it didn’t seem to make a difference. Maybe we’re doing something wrong :man_shrugging:

    const store: TreeDatastoreMethods = this.gantt.createDatastore({
      name: this.gantt.config.resource_store,
      type: 'treeDatastore',
      fetchTasks: false,
      initItem: (item: IResource) => {
        item.parent = item.parent ?? rootId;
        Object.defineProperty(item, this.gantt.config.resource_property, {value: item.parent});
        item.open = true;
        return item;
      }
    });

Hello Coman,
You also need to make sure that the gantt.config.resources.resource_store.fetchTasks is not enabled:
https://docs.dhtmlx.com/gantt/api__gantt_resources_config.html#:~:text=flat%20list%20datastore.-,fetchTasks,--%20(boolean)%20enables

If the issue is reproduced when the tasks are not displayed in the resource panel, please send me a snippet or a ready demo so that I can reproduce the issue locally.

Hello Coman,
The dev team improved performance for the resource panel in the 8.0 and 8.0.3 versions:
https://docs.dhtmlx.com/gantt/whatsnew.html#x6629x80x6630x:~:text=reduced%20amount%20of%20boilerplate%20code%20required%20to%20use%20the%20Resource%20panel

https://docs.dhtmlx.com/gantt/whatsnew.html#x6629x80x6630x:~:text=Performance%20improvements%20for%20the%20Resource%20Panel

You can see how it works in the following sample:
https://docs.dhtmlx.com/gantt/samples/08_api/10_performance_tweaks.html