From cc7ad4e415096e0f6840ca5e90762988e0a1afe7 Mon Sep 17 00:00:00 2001 From: asztrikx Date: Fri, 27 Aug 2021 23:34:23 +0200 Subject: [PATCH 1/2] improved ArgTrace's speed --- .../hu/bme/mit/theta/analysis/algorithm/ArgTrace.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/ArgTrace.java b/subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/ArgTrace.java index ecbe8fef72..989fad7c3a 100644 --- a/subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/ArgTrace.java +++ b/subprojects/common/analysis/src/main/java/hu/bme/mit/theta/analysis/algorithm/ArgTrace.java @@ -37,6 +37,7 @@ public final class ArgTrace implements Iterab private final List> edges; private ArgTrace(final ArgNode node) { + // adding items to first index will lead to O(N^2) performance final List> nodeList = new ArrayList<>(); final List> edgeList = new ArrayList<>(); @@ -46,9 +47,14 @@ private ArgTrace(final ArgNode node) { while (running.getInEdge().isPresent()) { final ArgEdge inEdge = running.getInEdge().get(); running = inEdge.getSource(); - edgeList.add(0, inEdge); - nodeList.add(0, running); + edgeList.add(inEdge); + nodeList.add(running); } + + // create the correct order by reversing O(N) + Collections.reverse(nodeList); + Collections.reverse(edgeList); + this.nodes = Collections.unmodifiableList(nodeList); this.edges = Collections.unmodifiableList(edgeList); } From a8851d348e9f392e0d5eeaec1de00fc64f1a13dc Mon Sep 17 00:00:00 2001 From: asztrikx Date: Mon, 30 Aug 2021 22:31:53 +0200 Subject: [PATCH 2/2] bumped path version --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 78adf98581..103e32b2c0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ buildscript { allprojects { group = "hu.bme.mit.inf.theta" - version = "2.22.0" + version = "2.22.1" apply(from = rootDir.resolve("gradle/shared-with-buildSrc/mirrors.gradle.kts")) }