Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: lib/src/util.dart

Issue 2201903004: add tool to get breakdown of deferred libraries by size (Closed) Base URL: git@github.com:dart-lang/dart2js_info.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js_info.src.util; 5 library dart2js_info.src.util;
6 6
7 import 'dart:async';
8 import 'dart:convert';
9 import 'dart:io';
10
7 import 'package:dart2js_info/info.dart'; 11 import 'package:dart2js_info/info.dart';
12
8 import 'graph.dart'; 13 import 'graph.dart';
9 14
10 /// Computes a graph of dependencies from [info]. 15 /// Computes a graph of dependencies from [info].
11 Graph<Info> graphFromInfo(AllInfo info) { 16 Graph<Info> graphFromInfo(AllInfo info) {
12 print(' info: dependency graph information is work in progress and' 17 print(' info: dependency graph information is work in progress and'
13 ' might be incomplete'); 18 ' might be incomplete');
14 // Note: we are combining dependency information that is computed in two ways 19 // Note: we are combining dependency information that is computed in two ways
15 // (functionInfo.uses vs allInfo.dependencies). 20 // (functionInfo.uses vs allInfo.dependencies).
16 // TODO(sigmund): fix inconsistencies between these two ways, stick with one 21 // TODO(sigmund): fix inconsistencies between these two ways, stick with one
17 // of them. 22 // of them.
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } else { 122 } else {
118 sb.write(' + '); 123 sb.write(' + ');
119 } 124 }
120 helper(sub); 125 helper(sub);
121 } 126 }
122 sb.write(')'); 127 sb.write(')');
123 } 128 }
124 helper(metric); 129 helper(metric);
125 return sb.toString(); 130 return sb.toString();
126 } 131 }
132
133 Future<AllInfo> infoFromFile(String fileName) async {
134 var file = await new File(fileName).readAsString();
135 return new AllInfoJsonCodec().decode(JSON.decode(file));
136 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698