Batch delete/create nodes in ProjectManager #6448
Conversation
if (added.length > 0) { | ||
var addedJSON = []; | ||
|
||
added.forEach(function (addedEntry) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.filter
instead of .forEach
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Your commits look good to me 👍 Either let me know changes you'd like to see w.r.t. the memoization stuff, or just push the merge button! |
* @return {number} Comparator value | ||
*/ | ||
var _projectTreeSortComparator = _.memoize(function (a, b) { | ||
var a1 = _getComparableName(a), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you were profiling this where was most of the time spent? Could we optimize more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's much more room for improvement by way of memoization. Most of the time was spent in FileUtils.compareFilenames.
Using the entry for the name and entry type could be slightly faster than asking for DOM properties. It's probably slight though because it only happens once per node because of the memoization.
@iwehrman I made some minor changes to sorting that you might want to take a quick look at. |
Batch delete/create nodes in ProjectManager
Everybody hold on to your butts! |
CODE OF CONDUCT |
I struggled to find the appropriate emoji for that |
@iwehrman
_redraw