Closed mshoote closed 7 years ago
Good question. :) There are a few things, including (and I may be forgetting things):
Updates are batched into animationFrames
It has a noIndex
option that makes it O(1)
in terms of computational complexity
DOM nodes are re-used for re-ordering/deletion/inserts within the same animation frame
It can re-use the Knockout Context with a noContext
option
So, in other words, in the average case it'll have fewer reflows because DOM changes are batched into animation frames. When given options noIndex
it will scale to relatively huge numbers because each addition has constant-time computational complexity.
I hope that helps explain. (It's also possible I've forgotten something, mind you ...)
Thank you for the response! That helps a lot.
So this issue can be closed?
Yes this issue can be closed.
Hi, I was wondering what exactly makes fast for each faster than the normal for each.
I noticed in the .js you mention: "Employing sound techniques to make a faster Knockout foreach binding."
I am not sure if these sound techniques make it faster and if so what are sound techniques?
I am wondering as I am doing a comparison of frameworks and was wondering what made this faster.