-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(StateRegistry): improve perf for:
.register()
and `StateMatche…
…r.find()` misses The `.find()` function is pretty hot/frequently used. When possible, a state is found using a property look up `this._states[name]` If a state isn't found using an exact match, another attempt is made to do a glob match. The glob match allows a future state such as `future.state.**` to be matched for any child such as `future.state.child.nested`. This causes unnecessary overhead especially during bootup and registration. Before registering a state, we first check to see if it already exists. This change does three things: 1) Only state names that *might* be a glob are tested 2) The Globs for states with glob-like names are cached 3) Do not use globs in `.register()` when checking for "State foo is already defined" Related to #27 Related to angular-ui/ui-router#3274
- Loading branch information
1 parent
4193244
commit fdb3ab9
Showing
6 changed files
with
42 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters