-
Notifications
You must be signed in to change notification settings - Fork 76
Tuning widget performance
Will Leingang edited this page Sep 7, 2017
·
3 revisions
- Test your widget on a blank page $sp.do
- Check angular watchers using browser tools
- Use one-time binding wherever possible
- Don’t use $timeout
- use scope.$evalAsync() or scope.$applyAsync()
- If you are using recordwatchers make sure you are looking for specific records not big queries with lots of changing records.
- Avoid auto refreshing widgets
- Don’t call server.update() inside a timeout()
- Avoid using angular filters
- Use javascript functions to pre sort and filter your collections
- Use ng-if instead of ng-show
- Use a shared data service so that widgets don’t have to fetch the same data from the server
- Use a scripted rest API for getting data
- Calling server.update() can be costly since it also returns the widget template, client script, and widget dependencies.