-
Notifications
You must be signed in to change notification settings - Fork 153
Performance Problem #198
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
Comments
You're right about the watchers. But they should be rather light. To diagnose this correctly:
Angular.JS doesn't have a problem with large numbers of watches (and we go to great length to make sure they're light): what you do in each watch is much more important than how many you have. Use a profiler first to pinpoint the exact cause of slowdowns. If it turns out that angular-gettext is the problem, do provide us with the profiling results and (if possible) a sample of code to show how you've brought it to its knees. I'm very interested in how this happened. |
Sorry for the late reply,
I am still very much interested in one way binding, as we detect the language from users language preference in google accounts. So we only change on runtime and we don't really have to change it ones app is loaded (hope i am making sense). You are partially right about "Angular.JS doesn't have problem with large number of watches" - it depends upon how much memory your browser uses . And considering Chrome most memory-intensive browsers out there - does get effected with number of watches on not so powerful machines such as chrome book. Decrease in number of watches did improve the performance. I am still investigating but so far I found out
But overall thank you for this awesome translation 👍 But would love to see one way binding. Please let me know if you have any questions. Thanks |
Can't you just use one-time bindings on the result? |
On this note, we've forked angular-gettext to remove the Another area for improvement we were looking at is removing the $watch on each of the translations. At the moment each translation listens for gettextLanguageChanged to update strings. When we change our language, we're forcing a page refresh, as we've got quite a few other cases to handle (refreshing data within components, re-translating the URL etc etc). I think it would be nice to have the two-way binding configurable. I'm sure there are a few other people who would prefer to force-refresh than add 500 watchers per page :) There's a PR pending #140 for turning the directives into providers. Perhaps it would be good to also add the configurable option there for:
|
Hi,
In my application i am using translation at many places. After doing some debugging, i found out that for each translate there is a watcher, which is destroying the performance of entire app. Is there a way to do the one way binding for this ? or any other way to increase the performance ? I am on recent version 2.1.0.
Hoping to hear from you soon.
The text was updated successfully, but these errors were encountered: