@@ -26,21 +26,21 @@ Read [Code Snippets tutorial][1],
26
26
[ Performance profiling using DevTools code snippets] [ 2 ] and
27
27
[ How to improve Angular application performance using code snippets] [ 3 ] .
28
28
29
- Note: code snippets do NOT have access to the full console API, for example no access to
29
+ Note: code snippets do NOT have access to the full console API, for example no access to
30
30
` console.monitor ` .
31
31
32
32
## Snippets
33
33
34
34
### DOM and CPU generic performance
35
35
36
- * [ boilerplate.js] ( boilerplate.js ) - boilerplate for loading and running a remote code script
36
+ * [ boilerplate.js] ( boilerplate.js ) - boilerplate for loading and running a remote code script
37
37
(see [ remote download] ( #remote-download ) ).
38
38
* [ first-paint.js] ( first-paint.js ) - time from page reload to first visible contents.
39
- * [ timing.js] ( timing.js ) - Detailed page timing information,
39
+ * [ timing.js] ( timing.js ) - Detailed page timing information,
40
40
from [ addyosmani/timing.js] ( https://github.com/addyosmani/timing.js ) .
41
41
* [ time-method-call.js] ( time-method-call.js ) - measures single method call time.
42
42
* [ profile-method-call.js] ( profile-method-call.js ) - profiles a single method call.
43
- * [ profile-prototype-method.js] ( profile-prototype-method.js ) - profiles a single method call
43
+ * [ profile-prototype-method.js] ( profile-prototype-method.js ) - profiles a single method call
44
44
that is on a prototype object, not on an instance.
45
45
* [ profile-separate-calls.js] ( profile-separate-calls.js ) can profile actions where separate
46
46
method calls start and stop the operation.
@@ -54,9 +54,9 @@ take up in a collection of objects, read [Measuring Space Allocation][measure].
54
54
55
55
### Angular performance
56
56
57
- * [ ng-count-watchers.js] ( ng-count-watchers.js ) - counts total watchers in the page.
57
+ * [ ng-count-watchers.js] ( ng-count-watchers.js ) - counts total watchers in the page.
58
58
More watchers - slower digest cycle.
59
- * [ ng-idle-apply-timing.js] ( ng-idle-apply-timing.js ) - measures how long a digest cycle takes without
59
+ * [ ng-idle-apply-timing.js] ( ng-idle-apply-timing.js ) - measures how long a digest cycle takes without
60
60
any data changes. This measures purely how long all watched expressions take to compute and compare
61
61
to previous values (dirty checking).
62
62
* [ ng-profile-scope-method.js] ( ng-profile-scope-method.js ) - installs profile calls around a given
@@ -87,18 +87,18 @@ All snippets, including mine are distributed under MIT license.
87
87
## Updating local code snippets
88
88
89
89
You can update local code snippets by downloading new versions from this github repository.
90
- Create a code snippets and copy source from [ update-code-snippets.js] ( update-code-snippets.js ) .
90
+ Create a new code snippet and copy the source from [ update-code-snippets.js] ( update-code-snippets.js ) .
91
91
92
92
You will run this code snippet in an unusual way. First, open any web page, even an empty tab.
93
- Open the DevTools in ** undocked** mode (Command+Option+I on Mac). Then open the DevTools ** again** ,
93
+ Open the DevTools in ** undocked** mode (Command+Option+I on Mac). Then open the DevTools ** again** ,
94
94
* while focused* on the first DevTools. This will open the second DevTools instance with the source for the
95
95
first DevTools panels. If you inspect the ` localStorage ` variable in the second DevTools window, you will
96
96
find lots of interesting stuff, including all the code snippets in the ` localStorage.scriptSnippets ` property.
97
97
98
98
Whenever you want to update the your local code snippets in the Chrome DevTools, execute the ` update-code-snippets.js `
99
- snippet in the second DevTools instance. The update script looks at the your current code snippets and
100
- tries to download a file with same name from the code snippets github repository (via [ RawGit] [ RawGit ] ).
101
- If the remote file has been downloaded successfully, it will replace the snippet.
99
+ snippet in the second DevTools instance. The update script looks at the your current code snippets and
100
+ tries to download a file with same name from the code snippets github repository (via [ RawGit] [ RawGit ] ).
101
+ If the remote file has been downloaded successfully, it will replace the snippet.
102
102
After all snippets are checked, reopen the DevTools to load the updated source code.
103
103
104
104
![ update code snippets] ( images/update-code-snippets.png )
@@ -109,7 +109,7 @@ want to override a code snippet - just rename it, for example, remove the `.js`
109
109
110
110
## Remote download a single script
111
111
112
- You can download and run a single snippet by using the following boilerplate
112
+ You can download and run a single snippet by using the following boilerplate
113
113
(scripts are via downloaded via [ RawGit] [ RawGit ] )
114
114
115
115
``` js
0 commit comments