From d8feb04938879792958efd804aa7a72608308c6f Mon Sep 17 00:00:00 2001 From: Florian Steurer Date: Wed, 20 Apr 2016 17:10:26 +0200 Subject: [PATCH] time log --- src/de/dhbwstuttgart/syntaxtree/SourceFile.java | 4 ++++ src/de/dhbwstuttgart/typeinference/unify/TypeUnify.java | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/de/dhbwstuttgart/syntaxtree/SourceFile.java b/src/de/dhbwstuttgart/syntaxtree/SourceFile.java index 71e82930..9f829e46 100755 --- a/src/de/dhbwstuttgart/syntaxtree/SourceFile.java +++ b/src/de/dhbwstuttgart/syntaxtree/SourceFile.java @@ -361,8 +361,12 @@ public class SourceFile */ typinferenzLog.debug("\nUnifiziere Constraints:\n"+constraints, Section.TYPEINFERENCE); typinferenzLog.debug("\nFC:\n"+finiteClosure, Section.TYPEINFERENCE); + long start = System.currentTimeMillis(); Set> unifyResult = new TypeUnify().unify(constraints, finiteClosure); + long time = System.currentTimeMillis()-start; typinferenzLog.debug("\nErgebnis der Unifizierung:\n"+unifyResult, Section.TYPEINFERENCE); + typinferenzLog.debug("\nZeit für Unifizierung: "+time + "ms", Section.TYPEINFERENCE); + Menge> convertedResult = unifyResult.parallelStream().>map((Set resultSet)->{ Menge innerConvert = resultSet.stream().map((UnifyPair mp)->UnifyTypeFactory.convert(mp)) diff --git a/src/de/dhbwstuttgart/typeinference/unify/TypeUnify.java b/src/de/dhbwstuttgart/typeinference/unify/TypeUnify.java index 2e0d70fd..031576d9 100644 --- a/src/de/dhbwstuttgart/typeinference/unify/TypeUnify.java +++ b/src/de/dhbwstuttgart/typeinference/unify/TypeUnify.java @@ -49,7 +49,9 @@ public class TypeUnify { */ protected IRuleSet rules = new RuleSet(); - protected boolean parallel = true; + // Scheint momentan eher zu verlangsamen, vermutlich zu viele threads, + // threadpool und task-queue einbauen und minimale problemgröße für neuen thread + protected boolean parallel = false; /** * Computes all principal type unifiers for a set of constraints.