Skip to content
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

Merged
merged 5 commits into from
Mar 11, 2019
Merged

Performance updates #63

merged 5 commits into from
Mar 11, 2019

Conversation

brunobar79
Copy link
Contributor

@brunobar79 brunobar79 commented Mar 11, 2019

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 and selectedAddress 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.

@codecov-io
Copy link

Codecov Report

Merging #63 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #63   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          20     20           
  Lines        1081   1086    +5     
  Branches      123    125    +2     
=====================================
+ Hits         1081   1086    +5
Impacted Files Coverage Δ
src/AssetsController.ts 100% <ø> (ø) ⬆️
src/NetworkController.ts 100% <ø> (ø) ⬆️
src/AccountTrackerController.ts 100% <100%> (ø) ⬆️
src/AssetsDetectionController.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2dd47bf...0917538. Read the comment docs.

Copy link
Contributor

@bitpshr bitpshr left a 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.

@brunobar79 brunobar79 merged commit 51eb781 into master Mar 11, 2019
@bitpshr bitpshr deleted the performance-updates branch March 11, 2019 15:28
mcmire pushed a commit to mcmire/core that referenced this pull request Jul 17, 2023
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>
kanthesha pushed a commit that referenced this pull request Oct 11, 2023
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
* some performance updates

* fix asset detection when no selectedAddress

* increase polling interval to 12s

* set default network to mainnet

* set node version to 8
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
* some performance updates

* fix asset detection when no selectedAddress

* increase polling interval to 12s

* set default network to mainnet

* set node version to 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants