Skip to content

Commit 4324f2b

Browse files
committed
improve sort performance by 2x (1s sort -> 600ms sort)
1 parent e087267 commit 4324f2b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/components/slow-node-times.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ export default Ember.Component.extend({
8080
}),
8181

8282
sortedNodes: computed('nodes', 'sortDescending', function() {
83+
let sortDescending = this.get('sortDescending');
8384
return this.get('nodes').sort((a, b) => {
84-
if (this.get('sortDescending')) {
85+
if (sortDescending) {
8586
return b._stats.time.plugin - a._stats.time.plugin;
8687
} else {
8788
return a._stats.time.plugin - b._stats.time.plugin;

0 commit comments

Comments
 (0)