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
can.stache performance #1011
Comments
Thanks for bringing this to my attention. I just checked my benchmark and somehow stache performance is about 2x as slow as I left it. I'll dig into it and discover why. My guess is that a bug was fixed in a non optimal way. |
So, this branch https://github.com/bitovi/canjs/tree/stache-perf has about 25% improvement (from 13ms to 9ms) where html bars is about 3ms. About 3ms of that difference seems to be how we are setting attributes so they "might" publish DOM modification events and we will set cssText for IE8 compatibility. The rest of it seems to be around our events and computes. We used to have live-binding not create a compute. We might restore that. |
So much of the remaining performance difference has to do with the way CanJS sets up live binding. Ember does not support computed methods without explicitly specifying bindings. CanJS does. CanJS uses the technique for computed methods when evaluating something like:
This technique involves calling a function, seeing what can.__reading calls it makes, comparing it with previous can.__reading calls. That's unnecessary for a binding like I think we can improve performance significantly by optimizing for simple observable property binding. |
That gets CanJS down to 5ms per loop. This makes CanJS faster than all the live binders except HTMLBars which is 3.6ms. I think this is sufficient gains to be included in a 2.1.2. Future gains can be had by:
|
Down to 4.2ms. |
If someone pulls this ... they should try to remove attrParts completely. |
Set up a decent performance fiddle to gauge dom manipulation, hope it helps! |
@justinbmeyer Is there a pull request for getting the stache perf branch into 2.1.2? |
doesn't seem like it. Justin Meyer On Tue, Jun 10, 2014 at 4:25 PM, David Luecke notifications@github.com
|
Closed through the commits in #1048 |
Hi,
I found this script http://jsfiddle.net/rich_harris/R9HRM/ and tried to measure performance of can.stache in http://jsfiddle.net/yusufsafak/NtBGL/ . The performance of can.stache is really bad when compared to other libraries. Am I missing something?
Thanks,
Safak
The text was updated successfully, but these errors were encountered: