This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Commit 54fa16e
committed
perf: speed up shallowCopy and special case Attributes cloning
`for in` is much faster than `Object.keys()` but `for in` includes properties from the prototype.
http://jsperf.com/for-in-vs-object-keys2
All the uses of shallowCopy don't deal with objects with heavy prototypes, except for Attributes instances
in $compile.
For this reason it's better to special-case Attributes constructor and make it do it's own shallow copy.
This cleans up the Attribute/$compile code as well.1 parent fb00210 commit 54fa16e
3 files changed
+23
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
821 | 821 | | |
822 | 822 | | |
823 | 823 | | |
824 | | - | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
825 | 827 | | |
826 | 828 | | |
827 | 829 | | |
828 | | - | |
| 830 | + | |
829 | 831 | | |
830 | 832 | | |
831 | 833 | | |
| |||
836 | 838 | | |
837 | 839 | | |
838 | 840 | | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
| 841 | + | |
844 | 842 | | |
845 | 843 | | |
846 | 844 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
663 | 663 | | |
664 | 664 | | |
665 | 665 | | |
666 | | - | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
667 | 679 | | |
668 | | - | |
669 | 680 | | |
670 | 681 | | |
671 | 682 | | |
| |||
1459 | 1470 | | |
1460 | 1471 | | |
1461 | 1472 | | |
1462 | | - | |
| 1473 | + | |
1463 | 1474 | | |
1464 | | - | |
1465 | | - | |
1466 | | - | |
1467 | | - | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
1468 | 1479 | | |
1469 | 1480 | | |
1470 | 1481 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | 247 | | |
261 | 248 | | |
262 | 249 | | |
| |||
0 commit comments