Skip to content
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

(perf) Favor translate directive over the translate filter #1074

Closed
jniles opened this issue Dec 14, 2016 · 0 comments · Fixed by #1077
Closed

(perf) Favor translate directive over the translate filter #1074

jniles opened this issue Dec 14, 2016 · 0 comments · Fixed by #1077
Assignees
Labels

Comments

@jniles
Copy link
Contributor

jniles commented Dec 14, 2016

According to the angular-translate site, the translate directive is a better option than the filter. It also may result in much more readable code, for example:

<span>{{ 'SOME.KEY' | translate }}</span>
<!-- versus -->
<span translate>SOME.KEY</span>

The performance of these two should be compared. In particular, we should pay attention to the number of $watchers on every page. If we can drastically reduce the number of $watchers, we should do a major overhaul and refactor the entire application.

This should probably be investigated as soon as possible. I'll look into it sometime this week.

@jniles jniles added this to the Future milestone Dec 14, 2016
@jniles jniles self-assigned this Dec 14, 2016
jniles pushed a commit to jniles/bhima that referenced this issue Dec 15, 2016
This commit modifies the tree and settings page to use the `translate`
directive instead of the translate filter.  This result in an average
decrease of `$watchers` by 50%.  The original page average was 648
`$watchers` with the tree fully expanded, but falls to 351 `$watchers`
by using the translate directive.

This commit determines the validity of IMA-WorldHealth#1074 and closes IMA-WorldHealth#1074.
sfount pushed a commit that referenced this issue Dec 16, 2016
This commit modifies the tree and settings page to use the `translate`
directive instead of the translate filter.  This result in an average
decrease of `$watchers` by 50%.  The original page average was 648
`$watchers` with the tree fully expanded, but falls to 351 `$watchers`
by using the translate directive.

This commit determines the validity of #1074 and closes #1074.
@sfount sfount mentioned this issue Feb 8, 2017
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant