From d8feb04938879792958efd804aa7a72608308c6f Mon Sep 17 00:00:00 2001 From: Florian Steurer Date: Wed, 20 Apr 2016 17:10:26 +0200 Subject: [PATCH 1/3] 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 71e82930b..9f829e464 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 2e0d70fd1..031576d95 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. From 1a32ea9ce9421ca911ac05a3cc8e1d6035c72808 Mon Sep 17 00:00:00 2001 From: Florian Steurer Date: Wed, 20 Apr 2016 18:38:20 +0200 Subject: [PATCH 2/3] size of unify result --- src/de/dhbwstuttgart/syntaxtree/SourceFile.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/de/dhbwstuttgart/syntaxtree/SourceFile.java b/src/de/dhbwstuttgart/syntaxtree/SourceFile.java index 9f829e464..2464730b2 100755 --- a/src/de/dhbwstuttgart/syntaxtree/SourceFile.java +++ b/src/de/dhbwstuttgart/syntaxtree/SourceFile.java @@ -365,6 +365,7 @@ public class SourceFile Set> unifyResult = new TypeUnify().unify(constraints, finiteClosure); long time = System.currentTimeMillis()-start; typinferenzLog.debug("\nErgebnis der Unifizierung:\n"+unifyResult, Section.TYPEINFERENCE); + typinferenzLog.debug("\nAnzahl Lösungen:\n"+unifyResult.size(), Section.TYPEINFERENCE); typinferenzLog.debug("\nZeit für Unifizierung: "+time + "ms", Section.TYPEINFERENCE); From 16cbf8e1b7ddb7a297ce51311cb52939aab9a6e9 Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Thu, 21 Apr 2016 14:27:32 +0200 Subject: [PATCH 3/3] Fehler bei TPH Generierung behoben --- src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java b/src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java index af90b7bda..e82bdb52a 100644 --- a/src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java +++ b/src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java @@ -193,7 +193,7 @@ public class UnifyTypeFactory { public static Type convert(PlaceholderType t) { TypePlaceholder ret = TypePlaceholder.getInstance(t.getName()); if(ret == null){ //Dieser TPH wurde vom Unifikationsalgorithmus erstellt - ret = TypePlaceholder.fresh(t.getName(), NULL_NODE); + ret = TypePlaceholder.fresh(NULL_NODE); } return ret; }