Skip to content

Is there overhead / mem wastage to extensive .val reads? #124

Answered by Tao-VanJS
metaleap asked this question in Q&A
Discussion options

You must be logged in to vote

curDeps is always undefined if val is being accessed outside binding functions.

Regarding the performance penalty, I have submitted the benchmark of VanJS into https://github.com/krausest/js-framework-benchmark (see krausest/js-framework-benchmark#1353). During the submission, I tried a few micro-optimization techniques, including to avoid capturing the dependencies every time the binding function is called if we can know the dependencies ahead of time. But none of the micro-optimizations lead to statistical difference in the benchmark result. So I guess the overhead of accessing val property should be minimal.

That said, if you are accessing val property a lot in a binding function, you'…

Replies: 1 comment

Comment options

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