holiber / sl-vue-tree

Customizable draggable tree component for Vue.js
MIT License
344 stars 79 forks source link

Bad update algorithm #50

Open evgencode opened 5 years ago

evgencode commented 5 years ago

Everywere is used const newNodes = this.copy(this.currentValue); This is a very resource-intensive operation. I have the data with about 600 nodes. If I just select node JSON.parse(JSON.stringify(entity)) happens for whole tree. It works very very slow. I think it should to revise the update node algorithm.

Maybe this will help: https://jsperf.com/deep-copy-vs-json-stringify-json-parse/5

holiber commented 5 years ago

Thanks for noticing that. PRs are appreciated