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

Stringifying events takes a long time (in actions addon) #5551

Closed
leoyli opened this issue Feb 12, 2019 · 19 comments
Closed

Stringifying events takes a long time (in actions addon) #5551

leoyli opened this issue Feb 12, 2019 · 19 comments

Comments

@leoyli
Copy link
Contributor

leoyli commented Feb 12, 2019

Describe the bug
Action addon took surprisingly long time to response (freeze the screen >4 sec).

To Reproduce
Steps to reproduce the behavior:

  1. Given any dummy button component.
  2. Hook onClick action with action addon function.
  3. Wait >4 sec to get response, the UI is totally blocked and unresponsive

An example from official-storybook: http://localhost:9011/?path=/story/basics-link--no-cancel-w-onclick

Expected behavior
A instantaneous response <150ms.

Screenshots
screen-shot

A bit profiling here, I'm render my story into standalone iFrame mode. This profiling shows the complicated string operation happened down to the message channel:

profiling

Code snippets
If applicable, add code samples to help explain your problem.

System:

  • OS: MacOS Mojave
  • Device: MacBook Air 2013-mid
  • Browser: Chrome 72
  • Framework: React 16.8.1
  • Version: v5.0.0-beta.2

Additional context
The component is a pure material-ui button. I thought my custom addons have some role on this but I still have faced this issue even I only have 1 story and no other addon at all...

@tmeasday tmeasday added this to the v5.0.0 milestone Feb 14, 2019
@tmeasday
Copy link
Member

Probably stringifying the event object? @ndelangen ?

@leoyli
Copy link
Contributor Author

leoyli commented Feb 14, 2019

Maybe not relevant, but it seems that channel can not broadcast Symbol object? (will have to check on the case in node side for sure...)

@ndelangen
Copy link
Member

Indeed, I noticed this as well. Something is not right in the serialization, it used to work really fast :(

@tmeasday
Copy link
Member

I added a link to one of our stories in the description

@tmeasday tmeasday changed the title [v5.0.0-beta.2] Action addon took surprisingly long time to response (freeze the screen >4 sec) Stringifying events takes a long time (in actions addon) Feb 18, 2019
@tmeasday
Copy link
Member

This is really a bug in telejson maybe? In any case I will leave it to you @ndelangen.

@ndelangen
Copy link
Member

I'm on it

@ndelangen
Copy link
Member

Fixed

@shilman
Copy link
Member

shilman commented Feb 25, 2019

Hurrah!! I just released https://github.com/storybooks/storybook/releases/tag/v5.0.0-rc.6 containing PR #5751 that references this issue. Upgrade today to try it out!

Because it's a pre-release you can find it on the @next NPM tag.

@jack-sf
Copy link

jack-sf commented Jun 26, 2019

This issue is still apparent to us, even after upgrading the storybook to 5.1.9 .

Only adding depth: 3 fixes the problem, but that's a workaround, not a solution. As I've seen in #2590 , events shouldn't be serialized at all?

That's how it looks like for us:

image

Without the depth: 3, printing the event takes ~3-7s on my MacBook Air.

Probably because event.view is Window and window has an infinite recursion to itself (window.self === window).

@shilman shilman reopened this Jun 27, 2019
@shilman shilman modified the milestones: v5.0.0, 5.2.0 Jul 2, 2019
@tw15egan
Copy link
Contributor

Just chiming in to say that I'm experiencing this on 5.1.9 as well

@shilman
Copy link
Member

shilman commented Jul 26, 2019

Thanks @tw15egan. This was fixed in 5.2.0-alpha.36. I'll patch the fix into 5.1.10.

@tw15egan
Copy link
Contributor

Awesome! Thanks for the quick response 👍

@jack-sf
Copy link

jack-sf commented Aug 5, 2019

Mhm, FYI we had just had updated to 5.1.10 and the issue still persists.

@shilman shilman modified the milestones: 5.2.0, 5.1.x Aug 5, 2019
@shilman
Copy link
Member

shilman commented Aug 5, 2019

@ndelangen #7256 went out in 5.1.10 but the perf issue remains. Any chance you can take a look?

@shilman shilman modified the milestones: 5.1.x, 5.2.x Sep 23, 2019
@leepowelldev
Copy link

Can confirm we'll still seeing a big performance hit

@el-dav
Copy link

el-dav commented Nov 21, 2019

Still seeing this issue in 5.2.3

@shilman shilman modified the milestones: 5.2.x, 5.3.x Jan 11, 2020
@shilman shilman removed this from the 5.3.x milestone Jul 30, 2020
@stale
Copy link

stale bot commented Dec 26, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Dec 26, 2020
@jkeen
Copy link

jkeen commented Feb 1, 2021

Still seeing this issue in Storybook 5.3.17. Is changing the depth value still the only solution?

@stale stale bot removed the inactive label Feb 1, 2021
@shilman shilman added this to the 6.2 perf milestone Feb 17, 2021
@shilman shilman modified the milestones: 6.2 perf, 6.3 improvements Apr 1, 2021
@shilman
Copy link
Member

shilman commented Apr 1, 2021

We want to address this in 6.3. If you want to contribute to Storybook, we'll prioritize PR review for any fixes here. And if you'd like any help getting started, please jump into the #support channel on our Discord: https://discord.gg/storybook

@shilman shilman removed this from the 6.4 improvements milestone May 20, 2022
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

9 participants