Closed emilykl closed 2 months ago
The event ('dragfree add remove')
gets trigger for each individual node added. So initially it would get triggered 1000 times for this code you have provided. Adding a debounce
should fix this without changing any functionality.
Description
The below code instantiates a CyLeaflet instance with 1000 nodes. It takes about 3 seconds to load in my browser (Mac OS 12.6; Chrome 120.0). A plain
cyto.Cytoscape
instance with the same 1000 nodes loads in <0.5s.The profiler shows the code is spending a lot of time in this event handler:
which is triggered each time a node is added, removed, or dragged.
It makes sense that the event handler would be triggered while nodes are being added to the layout, but not clear why it's taking so much longer when part of
cyto.CyLeaflet
compared to justcyto.Cytoscape
. More investigation needed.Steps/Code to Reproduce
Expected Results
Actual Results
Versions