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

Core: Optimize storiesHash by removing unused parameters #11624

Merged
merged 3 commits into from
Jul 21, 2020

Conversation

shilman
Copy link
Member

@shilman shilman commented Jul 21, 2020

Issue: #11618 #11229

What I did

storiesHash is the manager-side version of the story store. Currently it's doing a bunch of unnecessary work merging story parameters up the hierarchy of stories/groups/roots, which can be slow for storybooks with large sets of parameters.

With @ndelangen:

  • Removed parameters for the root node (which we believe is safe)
  • Only propagate viewMode and docsOnly parameters up the tree, as they are used in group nodes

Performance implications

We saw a minor perf improvement on official-storybook. We assume this would be more pronounced for a more parameter-heavy/deeply nested storybook:

  • Before: setStories = 885ms
  • After: setStories = 640ms

How to test

  • CI / updated snapshots
  • Run official-storybook and verify
    • Search
    • Docs-only stories
    • View-mode stories

@shilman shilman added this to the 6.0 milestone Jul 21, 2020
Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

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

LGTM

@shilman shilman merged commit fd511fc into next Jul 21, 2020
@stof stof deleted the 11618-optimize-stories-hash branch May 25, 2022 09:30
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.

3 participants