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:
Igor Minar
2014-06-04 06:38:31 -07:00
committed by rodyhaddad
parent 9971fbb3e0
commit 8c6a8171f9
5 changed files with 34 additions and 50 deletions

View File

@@ -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();