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

Moving graphs and mining dashboard to a lazy loaded module #1682

Merged
merged 2 commits into from
May 20, 2022

Conversation

softsimon
Copy link
Member

@softsimon softsimon commented May 19, 2022

This is an attempt to separate the EChart and Graphs component to a separate lazy loaded module.

So if the user directly navigates to
/tx/
/block/
/address/
and other pages that doesn't contain a graph, that module won't be loaded and we should increase the initial loading time a lot.

Upon loading
/
/mining
/graphs
/tv

The lazy loaded bundle containing the graphs will be loaded.

The uncompressed main bundle is down from 2.3 MB to 1 MB.

To test this we need to make sure that nothing broke. That mainnet, testnet, Liquid and Bisq still works. Also make sure we didn't introduce any other annoyance or flicker. For example opening a block and clicking on a Mempool Block will now cause a small delay because the graph-bundle is required to display a mempool block.

@cla-bot cla-bot bot added the cla-signed label May 19, 2022
@wiz
Copy link
Member

wiz commented May 20, 2022

For example opening a block and clicking on a Mempool Block will now cause a small delay because the graph-bundle is required to display a mempool block.

That's because you need to pre-load the lazy-loaded bundles asynchronously in the background so they're already pre-cached in RAM by the time you need them to render the next page.

Copy link
Member

@wiz wiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK @ v2.4.0-dev [062a864a]

Excellent refactoring, huge performance gains for FCP 🚀

Before (Lighthouse Report)

Screen Shot 2022-05-20 at 20 04 58

After

Screen Shot 2022-05-20 at 20 06 34

@wiz wiz merged commit c872c07 into master May 20, 2022
@wiz wiz deleted the simon/lazy-loaded-modules branch May 20, 2022 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants