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

feat: Add option to load HTML on-demand #105

Open
samoilovd opened this issue Aug 1, 2023 · 2 comments
Open

feat: Add option to load HTML on-demand #105

samoilovd opened this issue Aug 1, 2023 · 2 comments
Labels
performance Improve performance of an existing feature

Comments

@samoilovd
Copy link

samoilovd commented Aug 1, 2023

The plugin significantly affects page loading performance on large component compositions (2000-3000+ lines of HTML), especially in Storybook 7.0 and 7.1 with on-demand stories loading enabled.

The difference is 2-3s to load page and PNG graphics VS almost instant loading (200-300ms) with disabled plugin.

Would be nice to have an option to load, prettify and transform HTML content only when the plugin's tab is active.

Here is result of 2 pages loading times with plugin enabled (Storybook 7.1):
Screenshot 2023-08-01 at 13 54 48
Screenshot 2023-08-01 at 13 55 10

Same pages with disabled plugin:
Screenshot 2023-08-01 at 13 56 14
Screenshot 2023-08-01 at 13 57 45

Using Google Web Vitals for measurements.

@samoilovd
Copy link
Author

samoilovd commented Aug 1, 2023

Network activity metrics. Cache disabled, empty cache and hard page reload.

Plugin enabled:

  1. 90 requests, 3.8 MB transferred, 10.2 MB resources, Finish: 5.53 s, DOMContentLoaded: 429 ms, Load: 1.02 s
  2. 121 requests, 4.3 MB transferred, 10.6 MB resources, Finish: 2.36 s, DOMContentLoaded: 455 ms, Load: 1.03 s

Plugin disabled:

  1. 89 requests, 3.0 MB transferred, 7.9 MB resources, Finish: 1.47 s, DOMContentLoaded: 147 ms, Load: 689 ms
  2. 120 requests, 3.4 MB transferred, 8.3 MB resources, Finish: 1.11 s, DOMContentLoaded: 148 ms, Load: 788 ms

@dejan-cti
Copy link

Yes, I can also confirm that performance significantly drops with this plugin enabled. This really needs to be improved, as it's not usable currently. Btw, I'm using version "@storybook/html": "^6.5.16"

@jeanfredrik jeanfredrik added the performance Improve performance of an existing feature label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Improve performance of an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants