Skip to content

Slow rendering for large arrays #530

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

Closed
dannymcpherson opened this issue Aug 29, 2015 · 10 comments
Closed

Slow rendering for large arrays #530

dannymcpherson opened this issue Aug 29, 2015 · 10 comments

Comments

@dannymcpherson
Copy link

When I load an array of ~40 elements, where each element is an object containing 8 properties, rendering slows down dramatically. I see this on Chrome, FF, and Safari using a high-end macbook pro.

It would be helpful to know if there are any workarounds, or if this is expected behavior.

Thanks!

@jbsaff
Copy link
Contributor

jbsaff commented Aug 29, 2015

Just for clarity, are you using the new builder? If not, swap out the bootstrap-decorator.js file from https://github.com/Textalk/angular-schema-form-bootstrap and see how it goes. My understanding is that the new builder is aiming to address just that sort of performance situation. You can read a little more about it here https://medium.com/@SchemaFormIO.

@davidlgj
Copy link
Contributor

@jbsaff @dannymcpherson Yes try out the new builder. Sadly it isn't a dramatic speedup currently. I've been looking at performance a lot lately and currently it's the angulars $compile and linking of the generated form that takes a long time. I don't think I'm doing something wrong, But there is just a lot of directives and bindings to go through. In the future I hope to get rid of some of them by using builder helper functions instead. For example setting a class if fieldHtmlClass option is set instead of having class="{{form.fieldHtmlClass}}" in every template.

So, yeah, to answer your question. It probably is expected behavior. Although I've mostly been doing performance analysis on tabs so there might be something fishy here.

@dannymcpherson
Copy link
Author

Quick update: installing angular-schema-form-bootstrap only made marginal improvements. As an example, one form went from taking 5s to about 3s. This is still quite a long time to wait for a web form to render. In addition, with angular-schema-form-bootstrap, the tabarrays initially render below the tabs (default tab position specified), or not at all, until a tab is clicked. Then it snaps to the correct position.

I look forward to future improvements. This is still an amazing tool :)

@zcapin
Copy link

zcapin commented Jan 8, 2017

Does making fields 'readonly' speeds up render process? I am making excel-like app, this tools seemed like an awesome solution, and now it seems angular is in the way...

@nicklasb
Copy link
Member

nicklasb commented Jan 8, 2017

You'll have to try, but I don't think that it would matter all that much.
A workaround solution is to window it and just work with part of the array.
@Anthropic, do you know if there will be any major applicable improvements on performance?

@Anthropic
Copy link
Member

@zcapin which version are you using, you are best off with the version of bootstrap decorator from that repo and the schema-form version from this repo, they make the arrays much better than with the version of bootstrap found in the release here. The new builder will improve performance more in future too as we migrate more elements into it instead of in the old decorator style or templates.

@zcapin
Copy link

zcapin commented Jan 9, 2017

I am using version 0.8.13 with bootstrap-decorator. But i have a huge form.json ~20000 rows, which leaves me helpless, there is simply no way that this works fast, and what happens after adding even more watchers... I think i read somewhere you made material-decorator that is very fast when compared to bootstrap-decorator? i read that on #635

@nicklasb
Copy link
Member

nicklasb commented Jan 9, 2017 via email

@zcapin
Copy link

zcapin commented Jan 10, 2017

Ok, i think i got it, removing duplicate keys seems to have a good impact :) Probably merging the form with the schema becomes problem? What happens?

My rendering took 10s before and now its only 4s :)

@Anthropic
Copy link
Member

Please re-open if you do not feel the question has been answered sufficiently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants