From fecc087993b6f227525861c2c5209a5ce6ef32da Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Sun, 22 Oct 2017 20:22:51 +0300 Subject: [PATCH] Print compilation statistics --- .../src/main/java/org/teavm/tooling/TeaVMTool.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java b/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java index 1e92d4f50..2a0dff753 100644 --- a/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java +++ b/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java @@ -459,6 +459,8 @@ public class TeaVMTool implements BaseTeaVMTool { fileTable.flush(); log.info("Cache updated"); } + + printStats(); } catch (IOException e) { throw new TeaVMToolException("IO error occurred", e); } @@ -515,6 +517,18 @@ public class TeaVMTool implements BaseTeaVMTool { } } + private void printStats() { + int classCount = vm.getWrittenClasses().getClassNames().size(); + int methodCount = 0; + for (String className : vm.getWrittenClasses().getClassNames()) { + ClassReader cls = vm.getWrittenClasses().get(className); + methodCount += cls.getMethods().size(); + } + + log.info("Classes compiled: " + classCount); + log.info("Methods compiled: " + methodCount); + } + private void copySourceFiles() { if (vm.getWrittenClasses() == null) { return;