mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
perf(Scope): change Scope#id to be a simple number
In apps that create lots of scopes (apps with large tables) the uid generation shows up in the profiler and adds a few milliseconds. Using simple counter doesn't have this overhead. I think the initial fear of overflowing and thus using string alphanum sequence is unjustified because even if an app was to create lots of scopes non-stop, you could create about 28.6 million scopes per seconds for 10 years before you would reach a number that can't be accurately represented in JS BREAKING CHANGE: Scope#$id is now of time number rather than string. Since the id is primarily being used for debugging purposes this change should not affect anyone.
This commit is contained in:
@@ -24,7 +24,7 @@ beforeEach(function() {
|
||||
}
|
||||
|
||||
// This resets global id counter;
|
||||
uid = ['0', '0', '0'];
|
||||
uid = 0;
|
||||
|
||||
// reset to jQuery or default to us.
|
||||
bindJQuery();
|
||||
|
||||
Reference in New Issue
Block a user