OLD | NEW |
1 # Dart2js Info | 1 # Dart2js Info |
2 | 2 |
3 This package contains libraries and tools you can use to process `.info.json` | 3 This package contains libraries and tools you can use to process `.info.json` |
4 files, which are produced when running dart2js with `--dump-info`. | 4 files, which are produced when running dart2js with `--dump-info`. |
5 | 5 |
6 The `.info.json` files contain data about each element included in | 6 The `.info.json` files contain data about each element included in |
7 the output of your program. The data includes information such as: | 7 the output of your program. The data includes information such as: |
8 | 8 |
9 * the size that each function adds to the `.dart.js` output, | 9 * the size that each function adds to the `.dart.js` output, |
10 * dependencies between functions, | 10 * dependencies between functions, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 information to compute dominance and reachability data. This information can | 74 information to compute dominance and reachability data. This information can |
75 sometimes help determine how much savings could come if the function was not | 75 sometimes help determine how much savings could come if the function was not |
76 included in the program. | 76 included in the program. |
77 | 77 |
78 * [`coverage_log_server`][coverage] and [`live_code_size_analysis`][live]: | 78 * [`coverage_log_server`][coverage] and [`live_code_size_analysis`][live]: |
79 dart2js has an experimental feature to gather coverage data of your | 79 dart2js has an experimental feature to gather coverage data of your |
80 application. The `coverage_log_server` can record this data, and | 80 application. The `coverage_log_server` can record this data, and |
81 `live_code_size_analysis` can correlate that with the `.info.json`, so you | 81 `live_code_size_analysis` can correlate that with the `.info.json`, so you |
82 determine why code that is not used is being included in your app. | 82 determine why code that is not used is being included in your app. |
83 | 83 |
84 * [`verify_deps`][verify_deps]: a tool that verifies that all elements are | |
85 reachable from the program's entrypoint. If there are unreachable elements, | |
86 this indicates that the dependency information is incomplete. | |
87 | |
88 Next we describe in detail how to use each of these tools. | 84 Next we describe in detail how to use each of these tools. |
89 | 85 |
90 ### Code deps tool | 86 ### Code deps tool |
91 | 87 |
92 This command-line tool can be used to query for code dependencies. Currently | 88 This command-line tool can be used to query for code dependencies. Currently |
93 this tool only supports the `some_path` query, which gives you the shortest path | 89 this tool only supports the `some_path` query, which gives you the shortest path |
94 for how one function depends on another. | 90 for how one function depends on another. |
95 | 91 |
96 Run this tool as follows: | 92 Run this tool as follows: |
97 ```bash | 93 ```bash |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 * Shut down the coverage server (Ctrl-C). This will emit a file named | 252 * Shut down the coverage server (Ctrl-C). This will emit a file named |
257 `mail.dart.js.coverage.json` | 253 `mail.dart.js.coverage.json` |
258 | 254 |
259 * Finally, run the live code analysis tool given it both the info and | 255 * Finally, run the live code analysis tool given it both the info and |
260 coverage json files: | 256 coverage json files: |
261 | 257 |
262 ```bash | 258 ```bash |
263 dart2js_info_live_code_size_analysis main.dart.info.json main.dart.coverage.json | 259 dart2js_info_live_code_size_analysis main.dart.info.json main.dart.coverage.json |
264 ``` | 260 ``` |
265 | 261 |
266 ### Verifying dependencies | |
267 | |
268 Coverage of dependency information may be incomplete. If there are elements that | |
269 are live in the output that are unreachable through dependencies from the | |
270 program's entrypoint, then we have incomplete dependency information. Note, | |
271 however, that all elements may be reachable from the entrypoint even if there | |
272 is missing dependency information. In order to verify that all elements are | |
273 reachable from the app's entrypoint, simply run the tool as so: | |
274 | |
275 ```bash | |
276 dart2js_info_verify_deps foo.info.json | |
277 ``` | |
278 | |
279 If all elements are reachable from the entrypoint, then the tool will return | |
280 with exitcode 0. Otherwise, the tool will output the list of all functions that | |
281 are not reachable from the entrypoint and return with exitcode 1. | |
282 | |
283 ## Code location, features and bugs | 262 ## Code location, features and bugs |
284 | 263 |
285 This package is developed in [github][repo]. Please file feature requests and | 264 This package is developed in [github][repo]. Please file feature requests and |
286 bugs at the [issue tracker][tracker]. | 265 bugs at the [issue tracker][tracker]. |
287 | 266 |
288 [repo]: https://github.com/dart-lang/dart2js_info/ | 267 [repo]: https://github.com/dart-lang/dart2js_info/ |
289 [tracker]: https://github.com/dart-lang/dart2js_info/issues | 268 [tracker]: https://github.com/dart-lang/dart2js_info/issues |
290 [code_deps]: https://github.com/dart-lang/dart2js_info/blob/master/bin/code_deps
.dart | 269 [code_deps]: https://github.com/dart-lang/dart2js_info/blob/master/bin/code_deps
.dart |
291 [lib_split]: https://github.com/dart-lang/dart2js_info/blob/master/bin/library_s
ize_split.dart | 270 [lib_split]: https://github.com/dart-lang/dart2js_info/blob/master/bin/library_s
ize_split.dart |
292 [coverage]: https://github.com/dart-lang/dart2js_info/blob/master/bin/coverage_l
og_server.dart | 271 [coverage]: https://github.com/dart-lang/dart2js_info/blob/master/bin/coverage_l
og_server.dart |
293 [live]: https://github.com/dart-lang/dart2js_info/blob/master/bin/live_code_size
_analysis.dart | 272 [live]: https://github.com/dart-lang/dart2js_info/blob/master/bin/live_code_size
_analysis.dart |
294 [function_analysis]: https://github.com/dart-lang/dart2js_info/blob/master/bin/f
unction_size_analysis.dart | 273 [function_analysis]: https://github.com/dart-lang/dart2js_info/blob/master/bin/f
unction_size_analysis.dart |
295 [verify_deps]: https://github.com/dart-lang/dart2js_info/blob/master/bin/verify_
deps.dart | |
296 [AllInfo]: http://dart-lang.github.io/dart2js_info/doc/api/dart2js_info.info/All
Info-class.html | 274 [AllInfo]: http://dart-lang.github.io/dart2js_info/doc/api/dart2js_info.info/All
Info-class.html |
OLD | NEW |