Description
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 to
InitializeArcJs
, you should be using thefilter
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:
- Add the filter, as @dkent600 suggests
- 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:
- Check out if we can refactor the loading code and not halt execution while waiting for initializeArcjs.