Skip to content

Commit 01f42a3

Browse files
authored
Report library-sizes using the library uri (#58)
1 parent a966ccb commit 01f42a3

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.5.17
2+
3+
* Make `live_code_size_analysis` print library URIs and not library names.
4+
15
## 0.5.16
26

37
* Split out IO dependency from `util.dart`, so all other utilities can be used

bin/function_size_analysis.dart

+7-7
Original file line numberDiff line numberDiff line change
@@ -79,25 +79,25 @@ showCodeDistribution(AllInfo info,
7979

8080
if (showLibrarySizes) {
8181
print(' --- Results per library ---');
82-
var totals = {};
82+
var totals = <LibraryInfo, int>{};
8383
var longest = 0;
8484
reported.forEach((info) {
8585
var size = info.size;
8686
while (info != null && info is! LibraryInfo) {
8787
info = info.parent;
8888
}
8989
if (info == null) return;
90-
var name = info.name;
91-
totals.putIfAbsent(name, () => 0);
92-
totals[name] += size;
93-
longest = math.max(longest, name.length);
90+
LibraryInfo lib = info;
91+
totals.putIfAbsent(lib, () => 0);
92+
totals[lib] += size;
93+
longest = math.max(longest, '${lib.uri}'.length);
9494
});
9595

9696
_showLibHeader(longest + 1);
9797
var reportedByLibrary = totals.keys.toList();
9898
reportedByLibrary.sort((a, b) => totals[b] - totals[a]);
99-
reportedByLibrary.forEach((name) {
100-
_showLib(name, totals[name], realTotal, longest + 1);
99+
reportedByLibrary.forEach((info) {
100+
_showLib('${info.uri}', totals[info], realTotal, longest + 1);
101101
});
102102
}
103103

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: dart2js_info
2-
version: 0.5.16
2+
version: 0.5.17
33

44
description: >
55
Libraries and tools to process data produced when running dart2js with

0 commit comments

Comments
 (0)