Performance issue with getConnectedGroupRelations method


#1

we are seeing performance issue with method, this.getConnectedGroupRelations where there are huge relations in a project, say about 500+ relations.

links = _this._linksBuilder.getLinkedTasks(); even though there is handle for link id, you are getting getLinkedTasks always(all 500 relations in this case)

when we tested with _this._linksBuilder.getLinkedTasks(id), seems there is a HUGE performance improvement.
is this a bug or you need all relations for calculations/auto scheduling?

Note: we are in gantt 6.3.3
we did some testing and we are seeing performance 4X… ex: ( _this._linksBuilder.getLinkedTasks(); with 5000 tasks having 5000 relations its taking 17 seconds to add a new dependency, with _this._linksBuilder.getLinkedTasks(id), is just taking 5 seconds to add a new relation !!..)


#2

Hello,
The getConnectedGroupRelations and getLinkedTasks are internal methods. It is not a good idea to use internal properties and functions as they may change and we won’t inform about that nor provide any instructions for migrating to a newer version.
Instead, you can use the public methods and properties. In the following snippet, it takes less than 1 second on my computer to obtain all linked tasks with the following method:

gantt.getConnectedGroup(7)

http://snippet.dhtmlx.com/5/10d05db05
https://docs.dhtmlx.com/gantt/api__gantt_getconnectedgroup.html


#3

Hello @ramil
Thank you so much for quick reply. and sorry for not being very clear in my post.
actually we are not consuming getConnectedGroupRelations

we are using gantt.autoSchedule(id). to auto schedule a task. and gantt.autoSchedule is internally using
getConnectedGroupRelations. thats how we found the issue i.e gantt.autoSchedule(id) is taking longer time and performance is not so good

Please advice


#4

@ramil can you please help me here…can you please clarify if its a defect or its working as expected ?


#5

Hello,
Thank you for the clarification.
Here is an example with 1000 tasks under the same project and enabled auto_scheduling:
http://snippet.dhtmlx.com/5/4fde31b1d
If I drag a task there, I don’t have the performance issues.
Even if I add the 6.3.3 version, everything still works correctly:
https://snippet.dhtmlx.com/5/6dc2aeb8b

The issue might occur because of Gantt configuration or something else, but it is hard to suggest what might be wrong as I don’t see your code.
Please, try reproducing the issue in the snippets above, then click on the “Share” button and copy the link.