-
Notifications
You must be signed in to change notification settings - Fork 18
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
Perfomance issues. "add" method #12
Comments
Awesome! Great feedback - look forward to seeing what you come up with! |
Has any progress been made in this direction so far? I also would be happy for this kind of improvement. The idea seems to be simple, and it's easy to gracefully degrade in older browsers by just simply using the original technic instead of document fragments. Groupable items should be easily gathered together because based on my tests KO organizes the array change notifications in the correct order (tested with push with multiple arguments, and splice with multiple inserts). I can try to put together a PR if noone has made it yet. |
@cervengoc I'd really love and appreciate a PR on this – I don't recall @losogudok sharing any progress, but @losogudok please let us know if you have. :) Cheers |
@cervengoc I'd be of the assumption you might as well look into doing a PR yourself as it's been a while. If you have the time to get a PR together then I'd appreciate it too (I'd certainly benefit from it). I briefly looked at this issue but time isn't on my side at the moment - never is :( |
@brianmhunt @AdamWillden yes, I've already started working on it, and the first results on a modern Chrome are stunning. Rendering time of 100-200 items in an array reduced to about 10%. I have technical difficoulties with contribution though, to be honest I've never used GitHub in this way yet. Is there any kind of docs where it's explain what to install, how to run tests, etc.? I would really appreciate it. |
@cervengoc Can you create a fork of this repo and push your changes to it? I'd love to have a look! Prerequisites are having nodejs/npm and gulp installed. To install gulp run |
@4ver Thanks, sure, I'll do it tomorrow |
@cervengoc @4ver Owing to my oversight, |
I've made a fork and a commit with my solution, anyone feel free to check it. I'd happy to hear your thoughts and ideas. All existing tests are passed, I didn't create any new though, because I have no idea how this enhancement could be tested. |
Thanks @cervengoc ! It's hard to tell what's happening -- if you look at the diff it looks like almost every line changed (which does not actually seem to be the case). Also it looks like you added the UMD headers to Is there any way you can clean up the changes so the diff simplifies down to the salient bits? When you've cleaned it up you can compare and start a Pull Request. Cheers @cervengoc ! |
@brianmhunt I'll try to clean it up. Sorry, I don't have any experiance here yet. Also, I'm using visual Studio which probably auto-formatted the code, and that can lead to such heavy change log. |
@brianmhunt OK, I reverted the previous commit, and made a new one, it seems to be much better. Please check it out. |
Ok, I've cleaned up the repo a bit and merged the PR as There's one issue that lingers, namely: the line https://github.com/brianmhunt/knockout-fast-foreach/blob/master/index.js#L236 causes a failure in PhantomJS 1.X (the preferred browser for testing on CircleCI). This is an older Webkit browser, so lots of things break and I am ok not supporting it, but it would be good if the auto-tests passed. I have tried the Opening a new issue, but closing this one. Thanks @cervengoc and all. |
Hi, I've done some benchmarks and realized that script bottleneck is "add" function. We can make it work faster!
First thing to do, is to group all new elements in virtual DOM (document fragment) and then insert them together. DOM operations are expensive.
I will try to solve this problem.
The text was updated successfully, but these errors were encountered: