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

Unified Diff: pkg/kernel/test/ast_membench.sh

Issue 2665723002: Implement canonical name scheme in kernel. (Closed)
Patch Set: Address Kevin's comments Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/kernel/lib/verifier.dart ('k') | pkg/kernel/test/baseline_tester.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/test/ast_membench.sh
diff --git a/pkg/kernel/test/ast_membench.sh b/pkg/kernel/test/ast_membench.sh
new file mode 100755
index 0000000000000000000000000000000000000000..c6803e6cd7b00934c0fd945568175edf138bdb14
--- /dev/null
+++ b/pkg/kernel/test/ast_membench.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+testdir=$(dirname $0)
+first_input=10
+first_output=$(mktemp)
+dart --print-metrics $testdir/ast_membench.dart $1 $first_input >/dev/null 2>$first_output
+second_input=20
+second_output=$(mktemp)
+dart --print-metrics $testdir/ast_membench.dart $1 $second_input >/dev/null 2>$second_output
+
+bytes1=$(fgrep 'heap.old.used.max' $first_output | head -n1 | cut -d' ' -f4)
+bytes2=$(fgrep 'heap.old.used.max' $second_output | head -n1 | cut -d' ' -f4)
+
+bytes=$(echo "($bytes2 - $bytes1)/($second_input - $first_input)" | bc)
+mega_bytes=$(echo "$bytes / 1000000" | bc)
+printf "Memory usage = %d B (%2.2f MB)" $bytes $mega_bytes
+echo
+
+rm -f $first_output $second_output
« no previous file with comments | « pkg/kernel/lib/verifier.dart ('k') | pkg/kernel/test/baseline_tester.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698