-
-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance updates #63
Conversation
Codecov Report
@@ Coverage Diff @@
## master #63 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 20 20
Lines 1081 1086 +5
Branches 123 125 +2
=====================================
+ Hits 1081 1086 +5
Continue to review full report at Codecov.
|
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.
Really clean PR, thanks for identifying and fixing all of this.
Bumps [@metamask/eslint-config](https://github.com/MetaMask/eslint-config) from 11.0.2 to 11.1.0. - [Release notes](https://github.com/MetaMask/eslint-config/releases) - [Commits](MetaMask/eslint-config@v11.0.2...v11.1.0) --- updated-dependencies: - dependency-name: "@metamask/eslint-config" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* some performance updates * fix asset detection when no selectedAddress * increase polling interval to 12s * set default network to mainnet * set node version to 8
* some performance updates * fix asset detection when no selectedAddress * increase polling interval to 12s * set default network to mainnet * set node version to 8
I've spent some time on the app side trying to identify the bottlenecks and this is the stuff I found:
Change network controller polling from 8 to 12 seconds (Based on https://etherscan.io/chart/blocktime blocktime was never below 13) so by changing this we're doing 30% less requests.
Update account balance in state right after each individual request. The state wasn't updating immediately causing a noticeable delay in the UI.
Make "mainnet" the default network. This is how every client is supposed to initialize by default so we're avoiding extra requests to another network on startup.
Prevent asset detection (tokens & collectibles) if the selectedAddress wasn't set.
provider
andselectedAddress
are two independent config settings and we should only try to detect assets once we have both.Don't verify network on new block - I couldn't find a good answer about why we should be calling infura with net_version right after getting a new block. This was doubling the amount of requests to infura on our end.
Unrelated: GABA is using the latest version of node for travisCI and jest broke in node 11.11.0, so I had to downgrade. Since we're using the latest stable version of node 8 in the app and extension, I've set it up like that here too.