commit | ade880a7b8473e6f7c5ff2b2233c880ae3a9b29e | [log] [tgz] |
---|---|---|
author | Sigmund Cherem <sigmund@google.com> | Fri Aug 14 17:29:50 2015 -0700 |
committer | Sigmund Cherem <sigmund@google.com> | Fri Aug 14 17:29:50 2015 -0700 |
tree | 70d18795d5dd57cf0b3d0ff85c491b389f8cc3d0 | |
parent | 2e083547d11ab27aa7bc0a1ffa650af97e6cdb9b [diff] |
Update travis to run only on dev version of the SDK
This package contains libraries and tools you can use to process .info.json
files, which are produced when running dart2js with --dump-info
.
The .info.json
files contain data about each element included in the output of your program. The data includes information such as:
.dart.js
output,All of this information can help you understand why some piece of code is included in your compiled application, and how far was dart2js able to understand your code. This data can help you make changes to improve the quality and size of your framework or app.
This package focuses on gathering libraries and tools that summarize all of that information. Bear in mind that even with all these tools, it is not trivial to isolate code-size issues. We just hope that these tools make things a bit earier.
Currently, most tools available here can be used to analyze code-size and attibution of code-size to different parts of your app. With time, we hope to add more data to the .info.json
files, and include better tools to help understand the results of type inference.
This package is still in flux and we might make breaking changes at any time. Our current goal is not to provide a stable API, we mainly want to expose the functionality and iterate on it. We recommend that you pin a specific version of this package and update when needed.
dumped info exposes a Dart representation of the .info.json
files. You can parse the information using AllInfo.parseFromJson
. For example:
import 'dart:convert'; import 'dart:io'; import 'package:dart2js_info/info.dart'; main(args) { var infoPath = args[0]; var json = JSON.decode(new File(infoPath).readAsStringSync()); var info = AllInfo.parseFromJson(json); ...
The following tools are a available today:
code_deps.dart
: simple tool that can answer queries about the dependency between functions and fields in your program. Currently it only supports the some_path
query, which shows a dependency path from one function to another.
library_size_split
: a tool that shows how much code was attributed to each library. This tool is configurable so it can group data in many ways (e.g. to tally together all libraries that belong to a package, or all libraries that match certain name pattern).
function_size_analysis
: a tool that shows how much code was attributed to each function. This tool also uses depedency information to compute dominance and reachability data. This information can sometimes help determine how much savings could come if the function was not included in the program.
coverage_log_server
and live_code_size_analysis
: dart2js has an experimental feature to gather coverage data of your application. The coverage_log_server
can record this data, and live_code_size_analysis
can correlate that with the .info.json
, so you determine why code that is not used is being included in your app.
Please file feature requests and bugs at the issue tracker.