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

JS thread stalls when using multiple animations #48

Open
tuckerconnelly opened this issue Nov 29, 2016 · 9 comments
Open

JS thread stalls when using multiple animations #48

tuckerconnelly opened this issue Nov 29, 2016 · 9 comments

Comments

@tuckerconnelly
Copy link

It just stalls for a second. Could do what React Native is doing and offload animations to a WebWorker.

@browniefed
Copy link
Member

Web workers cannot access the dom

@tuckerconnelly
Copy link
Author

Is it DOM manipulation that's stalling it? Was thinking we could offload all the interpolations and such, and use postMessage to update the value/DOM property.

@browniefed
Copy link
Member

Not sure what exact issue you are having. Can you post an example where you are seeing it stall?

@tuckerconnelly
Copy link
Author

tuckerconnelly commented Nov 29, 2016

Uhh yeah, releasing a pretty big UI library in a couple days that depends on animated. I'll put a link here when it's up.

@tuckerconnelly
Copy link
Author

Alright, it's up: https://carbon-ui.com

It's not as noticeable on production, and I did some optimizations, but in the menu especially there's some jag

@tuckerconnelly
Copy link
Author

We could also cleverly implement useNativeDriver and use css transitions and classnames to provide "native" animations.

@browniefed
Copy link
Member

That would honestly probably be more complicated and brittle. I haven't done any profiling on this but the animated lib uses rAF and direct manipulation of the DOM so I'm not totally certain about where the slowness is coming from.

@browniefed
Copy link
Member

For the record this is a total beta library, never anticipated it being deployed in a production library.

@lelandrichardson
Copy link
Contributor

@tuckerconnelly can you put up a minimal example that creates some slowness? perhaps a codepen? How many simultaneous animations are we talking about here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants