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

Reactivity to update troisjs components #17

Closed
SaFrMo opened this issue Mar 10, 2021 · 2 comments
Closed

Reactivity to update troisjs components #17

SaFrMo opened this issue Mar 10, 2021 · 2 comments

Comments

@SaFrMo
Copy link
Contributor

SaFrMo commented Mar 10, 2021

The note on the Render loop page warns against using Vue reactivity to update troisjs components, but I'm wondering if there's any possible way to make reactive data a reliable source of truth. Curious if you have any thoughts on this - I'm happy to look into it if that's not something you've already researched. Thank you!

@klevron
Copy link
Member

klevron commented Mar 10, 2021

If you don't need to animate complex objects and can afford few fps drop, you can use reactive data.

I made a mistake in Demo6 the other day (re-render the tube component each frame by updating a prop), it was slow, and after 6cfefd9 it was 60fps !

The problem is the use of proxy : https://www.measurethat.net/Benchmarks/Show/9603/0/proxy-setter-with-sub-operation-v-class

You can see here there is a huge difference :
image

@SaFrMo
Copy link
Contributor Author

SaFrMo commented Mar 10, 2021

Oh wow, that definitely explains it! Thanks for the fast and detailed response! 😄

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

2 participants