This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: use faster check for $$ prefix
Use two calls to charAt instead of substr to detect a $$prefix in the shallowCopy functions. This makes shallowCopy 25-50% faster (depending on which browser is used). http://jsperf.com/angular-shallow-copy Closes #5457
- Loading branch information
Showing
2 changed files
with
2 additions
and
2 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
cb29632
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incidentally (whilst ie8 is still supported :) ) this test performs an average of 8% slower (the new method) on ie8 http://jsperf.com/angular-shallow-copy
cb29632
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old and the new conditions are not equivalent.
Now the properties beginning with a single '$' are also removed from the resource.
cb29632
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just ran the latest version 6 times against ie8 and the "fasterone" was 8% slower 5 out of the 6 times i ran it
http://jsperf.com/angular-shallow-copy/4
cb29632
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated jsperf for changes in d2e4e49: http://jsperf.com/angular-shallow-copy/5