Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Conversation

@ghost
Copy link

@ghost ghost commented Sep 10, 2018

Closes #544

This PR mitigates the performance issue when there are lots of computed transactions in the transactions list.

screen shot 2018-09-10 at 14 15 07

The app still feels a little janky/sluggish (~800ms frame), but it's definitely an improvement and quick win over the previous result (~2000ms).

const all = [].concat(t, p, i);
let all = [].concat(t, p, i);
all.sort((a, b) => b.date.getTime() - a.date.getTime());
all = all.slice(0, 100);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine to do the slice in the return value (line 31). The performance bottleneck isn't V8 but rather the DOM.

} else {
store.invoices.push(transaction);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably easier to just clone store.transactions 101 times. No need for all the test logic here...

}
});
ComputedTransaction(store);
expect(store.computedTransactions.length, 'to equal', 100);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... since all we need to check is this.

@ghost
Copy link
Author

ghost commented Sep 10, 2018

@tanx thanks for the feedback - updated.

@tanx
Copy link
Contributor

tanx commented Sep 13, 2018

The app still feels a little janky/sluggish (~800ms frame), but it's definitely an improvement and quick win over the previous result (~2000ms).

Ok. Yeah a good first step. We should look into how we can improve performance further with fancier optimizations later.

@tanx tanx merged commit 8e5c8cc into lightninglabs:master Sep 13, 2018
@ghost ghost deleted the limit-transactions-history branch September 13, 2018 11:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant