Skip to content

State binding optimization #56

Answered by Tao-VanJS
efpage asked this question in Q&A
Jun 11, 2023 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Thanks for your question!

First, a note on performance: my hypothesis is that the native DOM implementation is smart enough to skip the execution when the underlying value property is not changed, and the overhead of testing whether the property is changed or not is negligible in benchmark testing. The general, the philosophy of VanJS is not being overly obsessed with performance benchmarking, as there are only sparse scenarios where benchmarking results could translate to noticable difference in the user experience. However, the clarity and simplicity of the code matters in every application.

Back to the original questions, for this specific use case, should we use separate states? My op…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@efpage
Comment options

@Tao-VanJS
Comment options

Answer selected by Tao-VanJS
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants