Skip to content

Commit c1f11fe

Browse files
rmacnak-googleCommit Queue
authored andcommitted
[tools] Fix binary_size to work with Dart AOT snapshots.
- Make the size tools less dependent on quirks mode. - Add explicit language attribute so Chrome stops offering to translate. - Add zip_size to look at the Dart SDK and Flutter APKs. Change-Id: I0017bd68145344e2427644fcccd13f9b9f307218 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428064 Reviewed-by: Brian Quinlan <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent 0048e78 commit c1f11fe

File tree

5 files changed

+432
-14
lines changed

5 files changed

+432
-14
lines changed

runtime/tools/binary_size

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ main(List<String> args) {
9393

9494
var bloatyExec = "bloaty";
9595
var bloatyArgs = ["-d", "symbols,compileunits", "--domain=file", "-n", "0",
96-
"--csv", "--debug-file", unstrippedPath, strippedPath];
96+
"--tsv", "--debug-file", unstrippedPath, strippedPath];
9797
var bloatyResult = Process.runSync(bloatyExec, bloatyArgs);
9898
if (bloatyResult.exitCode != 0) {
9999
print("+ ${bloatyExec} ${bloatyArgs.join(' ')}");
@@ -105,7 +105,7 @@ main(List<String> args) {
105105

106106
var root = new Symbol();
107107
root.name = strippedPath;
108-
root.type = "path";
108+
root.type = "binary";
109109
root.shallowSize = 0;
110110
var paths = new Map<String, Symbol>();
111111
paths[""] = root;
@@ -140,7 +140,7 @@ main(List<String> args) {
140140
continue;
141141
}
142142

143-
var columns = line.split(",");
143+
var columns = line.split("\t");
144144
var name = columns[0];
145145
var path = columns[1];
146146
var vmSize = int.parse(columns[2]);
@@ -182,14 +182,14 @@ main(List<String> args) {
182182
}
183183

184184
var viewer = """
185-
<html>
185+
<html lang="en">
186186
<head>
187187
<style>
188188
.treemapTile {
189189
position: absolute;
190190
box-sizing: border-box;
191191
border: solid 1px;
192-
font-size: 13;
192+
font-size: 13px;
193193
text-align: center;
194194
overflow: hidden;
195195
white-space: nowrap;
@@ -392,10 +392,9 @@ function showDominatorTree(v) {
392392
setBody(fill);
393393
let w = document.body.offsetWidth;
394394
let h = document.body.offsetHeight;
395-
396395
let topTile = createTreemapTile(v, w, h, 0);
397-
topTile.style.width = w;
398-
topTile.style.height = h;
396+
topTile.style.width = w + "px";
397+
topTile.style.height = h + "px";
399398
setBody(topTile);
400399
401400
// Encode the current view into the URL fragment.

runtime/tools/graphexplorer/graphexplorer.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ BSD-style license that can be found in the LICENSE file.
6161
position: absolute;
6262
box-sizing: border-box;
6363
border: solid 1px;
64-
font-size: 10;
64+
font-size: 13px;
6565
text-align: center;
6666
overflow: hidden;
6767
white-space: nowrap;

runtime/tools/graphexplorer/graphexplorer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
for details. All rights reserved. Use of this source code is governed by a
44
BSD-style license that can be found in the LICENSE file.
55
-->
6-
<html>
6+
<html lang="en">
77
<head>
88
<title>Graph Explorer</title>
99
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

runtime/tools/graphexplorer/graphexplorer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@ function hash(string) {
12591259

12601260
function color(string) {
12611261
let hue = hash(string) % 360;
1262-
return "hsl(" + hue + ",60%,60%)";
1262+
return "hsl(" + hue + ",90%,80%)";
12631263
}
12641264

12651265
function prettySize(size) {
@@ -1322,7 +1322,7 @@ function createTreemapTile(graph, v, width, height, depth) {
13221322

13231323
let label = graph.nameOf(v) + " [" + prettySize(graph.retainedSizeOf(v)) + "]";
13241324
div.appendChild(document.createTextNode(label));
1325-
const kLabelHeight = 9;
1325+
const kLabelHeight = 13;
13261326
top += kLabelHeight;
13271327
height -= kLabelHeight;
13281328

@@ -1485,8 +1485,8 @@ function showDominatorTree(graph, v) {
14851485
let h = content.offsetHeight;
14861486

14871487
let topTile = createTreemapTile(graph, v, w, h, 0);
1488-
topTile.style.width = w;
1489-
topTile.style.height = h;
1488+
topTile.style.width = w + "px";
1489+
topTile.style.height = h + "px";
14901490
topTile.style.border = "none";
14911491
content.appendChild(topTile);
14921492
}

0 commit comments

Comments
 (0)