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

[optimization] optimize initialization of arc.js #199

Closed
jellegerbrandy opened this issue Nov 5, 2018 · 4 comments
Closed

[optimization] optimize initialization of arc.js #199

jellegerbrandy opened this issue Nov 5, 2018 · 4 comments

Comments

@jellegerbrandy
Copy link
Contributor

On first page load, there is a delay initializing arc.js. The delay seems a bit onpredicably, but is sometimes considerable (several seconds).

@jellegerbrandy wrote (in issue #194):

more lowhaning fruit: this line https://github.com/daostack/alchemy/blob/dev/src/index.tsx#L18 halts execution until arcjs is initialized. This can take some time, bc the init process also waits for establishing a websocket connection [<- I think] (whcih we are not using), which can take some time.

Solutions here are (a) do not await the initilization (which takes some tricky refactoring) and (b) make the initialization ligher (or the websocket optional) (I don't know about the latter, bc I have not looked yet at what the initilization actually is supposed to do)

@dkent600 replied:

@jellegerbrandy Regarding the call toInitializeArcJs, you should be using the filter configuration setting to speed it up. See here: https://daostack.github.io/arc.js/Configuration/#optimizedcontractloading.

I don't think it is using websockets at all.

What I think we shoudl look at is:

  1. Add the filter, as @dkent600 suggests
  2. Check out if web3 does not try to open a websocket anyway (my hunch is based on the fact that sometimes the app hands on loading at this point in devtools -> network:
    image
  3. Check out if we can refactor the loading code and not halt execution while waiting for initializeArcjs.
@jellegerbrandy
Copy link
Contributor Author

jellegerbrandy commented Nov 5, 2018

@dkent600 : Some more info:. for some reason metamask is not responding in my browser at this moment, and InitializeArcJS hangs completely

@dkent600
Copy link
Contributor

dkent600 commented Nov 5, 2018

@jellegerbrandy

Some more info:. for some reason metamask is not responding in my browser at this moment, and InitializeArcJS hangs completely

What do you see in the console in this case?

@jellegerbrandy
Copy link
Contributor Author

jellegerbrandy commented Nov 5, 2018 via email

@dkent600
Copy link
Contributor

dkent600 commented Nov 5, 2018

Long shot: What version of web3 are you using?

Are you providing the web3 instance to arc.js, or allowing arc.js to instantiate it itself? If the former, what provider are you using?

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

No branches or pull requests

2 participants