Storybook: Much higher CPU usage when moving from 5.1.X to 5.2.X on idle storybook

Created on 23 Oct 2019  路  17Comments  路  Source: storybookjs/storybook

I have a create-react-app (all packages to latest version) with 20-40 stories. When npm run storybook has finished and is simply running to monitor file changes, process node on 5.1.X idles at 2.5% but on 5.2.X idles at 30%.

System:

  System:
    OS: Linux 4.4 Ubuntu 16.04.5 LTS (Xenial Xerus)
    CPU: (2) x64 AMD FX(tm)-6300 Six-Core Processor
  Binaries:
    Node: 10.15.3 - /usr/bin/node
    Yarn: 1.15.2 - /usr/bin/yarn
    npm: 6.11.2 - /usr/bin/npm
  npmPackages:
    @storybook/addon-actions: 5.1.x => 5.1.11
    @storybook/addon-centered: 5.1.x => 5.1.11
    @storybook/addon-knobs: 5.1.x => 5.1.11
    @storybook/addons: 5.1.x => 5.1.11
    @storybook/react: 5.1.x => 5.1.11
  npmGlobalPackages:
    @storybook/cli: 4.0.9
bug high priority performance issue

Most helpful comment

I'm glad I helped. The medal goes to my slow workstation which allowed me to spot this issue in the first place :)

All 17 comments

I confirm this on Windows as well.

Thanks @cherouvim. I saw this in Storybook's official-storybook example and it was bothering me, but I couldn't repro it in a standalone project. Do you have a repro you can share?

I've created a reduced repro where I've also removed the addons just to make it simpler.

Currently on my windows machine, the node process when npm install & npm run storybook has completed and is idle:

Regarding the linked issue https://github.com/storybookjs/telejson/issues/26 note that I started Storybook 5.2.5 in a vanilla Ubuntu 18 VM and watch -c "netstat | fgrep tcp" didn't show any signs that storybook connected anywhere while starting up or while running (idling at 30%).

Thanks for checking @cherouvim. I figured that scenario is highly unlikely, but wanted to raise the concern just in case!

In case it helps, I've identified that the high CPU issue is introduced when moving from 5.1.11 to 5.2.0.

@cherouvim any interest in bisecting on the 5.2 alphas/betas to see exactly where this got introduced? it would help tremendously!

Will do and let you know ASAP.

I tested releases in the following order and found that the CPU issue must have been introduced in 5.2.0-alpha.36:

  • :-1: 5.2.0-beta.6
  • :-1: 5.2.0-beta.0
  • :+1: 5.2.0-alpha.23
  • :-1: 5.2.0-alpha.37
  • :+1: 5.2.0-alpha.30
  • :+1: 5.2.0-alpha.33
  • :+1: 5.2.0-alpha.35
  • :-1: 5.2.0-alpha.36

@cherouvim you are a hero 馃

@ndelangen how much do you want to bet it's this change: https://github.com/storybookjs/storybook/pull/6265

UPDATE: confirmed in official-storybook

@cherouvim Reverted & released as 5.3.0-alpha.35. Can you upgrade and confirm this fixes the problem on your end? If so I'll patch this out to 5.2.x!

Zoinks!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.3.0-alpha.35 containing PR #8657 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

I confirm that 5.3.0-alpha.35 solves the issue. Thanks.

@cherouvim Great work on tracking it down. Much appreciated!!!

You people absolutely 100% ROCK, @cherouvim You deserve a freaking medal 馃帠

I'm glad I helped. The medal goes to my slow workstation which allowed me to spot this issue in the first place :)

Great Caesar's ghost!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.2.6 containing PR #8657 that references this issue. Upgrade today to try it out!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rpersaud picture rpersaud  路  3Comments

tlrobinson picture tlrobinson  路  3Comments

MrOrz picture MrOrz  路  3Comments

shilman picture shilman  路  3Comments

wahengchang picture wahengchang  路  3Comments