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

Speed up page load and better sequence setSubs #559

Open
NealHumphrey opened this issue Sep 18, 2017 · 0 comments
Open

Speed up page load and better sequence setSubs #559

NealHumphrey opened this issue Sep 18, 2017 · 0 comments

Comments

@NealHumphrey
Copy link
Collaborator

NealHumphrey commented Sep 18, 2017

Save this until after the launch - recording now as an idea to consider for later.

In the loading of the tool, we use the setSubs method to sequence events that need to occur after other events. However, some of these events are scheduled later than they need to occur, and many of the events wait for some asset to be loaded externally before triggering internal code that performs things in the browser. We could achieve some performance improvements by cleaning up which events trigger what, to make sure that everything that could occur simultaneously to an asset download does occur. This assumes that the browser is able to achieve better performance by having multiple async requests at the same time.

The most likely candidate is that we wait to trigger the loadMetaData function in the map-view until the map is loaded from Mapbox; Mapbox loading takes 3-4 seconds, and most of the resulting funcionality doesn't need the map itself to be present.

Additional consideration while we're looking at improving the sequencing of the setSubs - eliminate errors like this one by making sure that code doesn't get called to early. These errors currently don't affect performance because the functions they happen in run fine later when triggered by user behavior, but would be good to eliminate:
image
image

@NealHumphrey NealHumphrey changed the title Speed up page load Speed up page load and better sequence setSubs Sep 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant