From db6f64eba3aeb79aa3404156e2fd2d953fee497f Mon Sep 17 00:00:00 2001 From: hoechp Date: Sat, 25 Feb 2017 01:25:26 +0100 Subject: [PATCH] #28 added caching of JEval node evaluators --- .gradle/3.2/taskArtifacts/fileHashes.bin | Bin 28247 -> 29797 bytes .gradle/3.2/taskArtifacts/fileSnapshots.bin | Bin 152779 -> 217067 bytes .gradle/3.2/taskArtifacts/taskArtifacts.bin | Bin 57569 -> 67941 bytes .gradle/3.2/taskArtifacts/taskArtifacts.lock | Bin 17 -> 17 bytes build.gradle | 4 +++ .../org/fujaba/graphengine/PatternEngine.java | 25 +++++++++++++++++- src/main/resources/data.json | 2 +- .../unitTests/RoadworkExample.java | 14 +++++----- 8 files changed, 36 insertions(+), 9 deletions(-) diff --git a/.gradle/3.2/taskArtifacts/fileHashes.bin b/.gradle/3.2/taskArtifacts/fileHashes.bin index f65763e6dc176bb02580f3c79e0b3148564ccaba..840cbb9eadbd110d96e03ba9149f3a4c91bda3e2 100644 GIT binary patch delta 4767 zcma)<2{ct}8^`w%2_5Hf%#mY=LkVTdP$|bPQmAA)Bn?W*P=*^FQ<*9qy8(r-WQYbj zl8Q*(u8OEcq?-nE%aBAR^u6zSw{LxS>s#x4);jNA>+%0R&+|^t-dZ~-T|JZ%BL&JE z+*rYYexTTj>+H|IhzTrs37?}-L7}HVGf4} zIpvYoM+ot2JWIul_1N2OYvZA@yU4lw{bYovdmqPtu7z{`_r zA&Y}Hs_zSKBLAL+_+d3BT{tP?%%wbslgJrxlb@&NN}0b{#9CSSQn%4D-x+y>pG{7{zGGv>`O-K;SbqZ%7!##$U43XqHbIP5i%FkuM~RKgr%CE@}&mPh4|Jh@@LrXUy)s}^y0SHW=lzi z`n(fhJt*$M>83d-f;fE4UkC;r@Kb|7y1Ke%z~usyl3jfx8uylrM-W6FZs?>(h3pj| z115Bqf7|{ng{fQ_yXVK+-Z7weqlRuihE&u)ajA_A)w&>>B)tp; ztG?rd0!^6T45XnS#J$(rD9Cv5#taj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w7FJH#f!OTDqml+`C^(8)8@Hp8B9zp zw>BS~@srUF7=qW085p>|85r1sG`le~vcXC_a;*Jb&;3R>*!W^wa>k0d^q(C^c^IZ$ zxC1uW1X(8;PGWc1yso5BKB)4nn47~-M&0(}{L-T2RH0~pt5y-~drXs4QVUY^Qd0Ah zE1eUQGg5&b>~sG(A!FCIY&3ssojX-75Ulstx;xMOs=CtM&4p7!*fz^gapavmXP?*R zfEB4sVm_wfd$bp9I0Lms<@C=>ci-KfJh4qwonb%otS~zTDKt|#Ihzi18C$Tq#O+cG ze^hpUa^aMS&GD=Mum&CZlhG)(*{&99)Q_dW?Q za1{9;ceeY=E1`REvo~*DHJc6S>VA$+rF90ckIz3k+3=KzRJ4l8&-=2MrMi-H5{ruq z5=$~p?owXA`~6<2$%*?V72Mi=>kndlHM1GcwCk1Av}!>S;4;&*Is%)zPihpa1a6$q(xT zHt<8 delta 943 zcmaDliRIxz<_RKiZtaZDBaHt&@=*-iIa|2I^0)kKD0YG5R3mWWH!&)fI(LJ)diS`GKrW z({xe(>3b_f&PeS#y-fIV=$^?3!}KP{#hl*!J9Z-Dx!Znu1KZ7)T9XB@1v1{A>=-ILIX+Bb^2F0}j91}2 zrGpZTSKz#fr^Pp0oXKU{y!@~x^X8P&-Ey0c&T{0PoUo8PNK9&Ob5Azkx|s8Xt3M^RxFj<#u_QA;4=7y2 z^o?=N%BEB1WqOC#bUa$Nxp0a$B z&e&|p|Mqd8`uhpVXtvm{_&WXl%+P#?E02;tFY6PWTsS3Sa{TJcK#Sy9!FH_J7kv3x z@*fAN9ab{7SI_;wx(%Bho>9754GXPLpxMFq=UBCAcAmxM5cbrtJKj@}?8so9{A{1= zX3bMIEWl7~V%w~K^%d7-(NiKE+pFfW_}YXqfn&Zl{FBz^oSEklF~5h;wV4gfJu1W5n@ diff --git a/build.gradle b/build.gradle index d3b195d..d1635a6 100644 --- a/build.gradle +++ b/build.gradle @@ -17,11 +17,15 @@ dependencies { // The production code uses the SLF4J logging API at compile time compile 'org.slf4j:slf4j-api:1.7.21' + // guava + compile group: 'com.google.guava', name: 'guava', version: '21.0' + // gson: compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0' // jeval: compile group: 'net.sourceforge.jeval', name: 'jeval', version: '0.9.4' + // Declare the dependency for your favourite test framework you want to use in your tests. // TestNG is also supported by the Gradle Test task. Just change the diff --git a/src/main/java/org/fujaba/graphengine/PatternEngine.java b/src/main/java/org/fujaba/graphengine/PatternEngine.java index 7e0b7af..110c4e9 100644 --- a/src/main/java/org/fujaba/graphengine/PatternEngine.java +++ b/src/main/java/org/fujaba/graphengine/PatternEngine.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; +import java.util.concurrent.TimeUnit; import javax.naming.spi.DirStateFactory.Result; @@ -16,6 +17,10 @@ import org.fujaba.graphengine.pattern.PatternGraph; import org.fujaba.graphengine.pattern.PatternNode; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; + import net.sourceforge.jeval.Evaluator; /** @@ -25,6 +30,23 @@ */ public class PatternEngine { + private static LoadingCache evaluatorCache = null; + + public static Evaluator getNodeEvaluator(Node node) { + if (evaluatorCache == null) { + CacheLoader evaluatorCacheLoader = new CacheLoader() { + public Evaluator load(Node node) { + return buildNodeEvaluator(node); + } + }; + evaluatorCache = CacheBuilder.newBuilder() + .maximumSize(5000) + .expireAfterWrite(10, TimeUnit.MINUTES) + .build(evaluatorCacheLoader); + } + return evaluatorCache.getUnchecked(node); + } + /** * Calculates a reachability graph based on a graph of the initial situation * and a prioritized list of patterns to match and apply on the graph and resulting graphs. @@ -953,7 +975,8 @@ public static Graph applyMatch(Match match) { } public static boolean evaluate(Node node, String expression) { - return evaluate(buildNodeEvaluator(node), expression); + //return evaluate(buildNodeEvaluator(node), expression); // uncached + return evaluate(getNodeEvaluator(node), expression); // cached } public static Evaluator buildNodeEvaluator(Node node) { Evaluator evaluator = new Evaluator(); diff --git a/src/main/resources/data.json b/src/main/resources/data.json index 60332a5..8d91e73 100644 --- a/src/main/resources/data.json +++ b/src/main/resources/data.json @@ -1 +1 @@ -{"nodes":[{"id":0,"label":"{graph\u003d1}","x":-0.03090169943749474,"y":-0.09510565162951536,"size":10,"color":"#00F"},{"id":1,"label":"{graph\u003d2}","x":-0.08090169943749474,"y":-0.058778525229247314,"size":10,"color":"#000"},{"id":2,"label":"{graph\u003d3}","x":-0.1,"y":-6.123233995736766E-18,"size":10,"color":"#000"},{"id":3,"label":"{graph\u003d4}","x":-0.08090169943749474,"y":0.0587785252292473,"size":10,"color":"#000"},{"id":4,"label":"{graph\u003d5}","x":-0.03090169943749475,"y":0.09510565162951536,"size":10,"color":"#000"},{"id":5,"label":"{graph\u003d6}","x":0.030901699437494774,"y":0.09510565162951536,"size":10,"color":"#000"},{"id":6,"label":"{graph\u003d7}","x":0.08090169943749473,"y":0.05877852522924733,"size":10,"color":"#000"},{"id":7,"label":"{graph\u003d8}","x":0.1,"y":1.8369701987210297E-17,"size":10,"color":"#000"},{"id":8,"label":"{graph\u003d9}","x":0.08090169943749476,"y":-0.05877852522924729,"size":10,"color":"#000"},{"id":9,"label":"{graph\u003d10}","x":0.03090169943749476,"y":-0.09510565162951536,"size":10,"color":"#000"}],"edges":[{"id":10,"label":"correctTranportRule","source":0,"target":1,"size":10,"color":"#888"},{"id":11,"label":"correctTranportRule","source":1,"target":0,"size":10,"color":"#888"},{"id":12,"label":"correctEmptyTranportRule","source":1,"target":2,"size":10,"color":"#888"},{"id":13,"label":"correctTranportRule","source":2,"target":3,"size":10,"color":"#888"},{"id":14,"label":"correctTranportRule","source":2,"target":4,"size":10,"color":"#888"},{"id":15,"label":"correctEmptyTranportRule","source":2,"target":1,"size":10,"color":"#888"},{"id":16,"label":"correctTranportRule","source":3,"target":2,"size":10,"color":"#888"},{"id":17,"label":"correctTranportRule","source":3,"target":5,"size":10,"color":"#888"},{"id":18,"label":"correctTranportRule","source":4,"target":6,"size":10,"color":"#888"},{"id":19,"label":"correctTranportRule","source":4,"target":2,"size":10,"color":"#888"},{"id":20,"label":"correctTranportRule","source":5,"target":3,"size":10,"color":"#888"},{"id":21,"label":"correctTranportRule","source":5,"target":7,"size":10,"color":"#888"},{"id":22,"label":"correctTranportRule","source":6,"target":7,"size":10,"color":"#888"},{"id":23,"label":"correctTranportRule","source":6,"target":4,"size":10,"color":"#888"},{"id":24,"label":"correctTranportRule","source":7,"target":6,"size":10,"color":"#888"},{"id":25,"label":"correctTranportRule","source":7,"target":5,"size":10,"color":"#888"},{"id":26,"label":"correctEmptyTranportRule","source":7,"target":8,"size":10,"color":"#888"},{"id":27,"label":"correctTranportRule","source":8,"target":9,"size":10,"color":"#888"},{"id":28,"label":"correctEmptyTranportRule","source":8,"target":7,"size":10,"color":"#888"},{"id":29,"label":"correctTranportRule","source":9,"target":8,"size":10,"color":"#888"}]} \ No newline at end of file +{"nodes":[{"id":0,"label":"{a0\u003dv0}","x":-0.015643446504023086,"y":-0.09876883405951378,"size":10,"color":"#00F"},{"id":1,"label":"{a0\u003dv0}","x":-0.04539904997395468,"y":-0.08910065241883679,"size":10,"color":"#000"},{"id":2,"label":"{a0\u003dv1}","x":-0.07071067811865475,"y":-0.07071067811865475,"size":10,"color":"#000"},{"id":3,"label":"{a0\u003dv2}","x":-0.08910065241883677,"y":-0.045399049973954685,"size":10,"color":"#000"},{"id":4,"label":"{a0\u003dv0}","x":-0.09876883405951378,"y":-0.015643446504023092,"size":10,"color":"#000"},{"id":5,"label":"{a0\u003dv2}","x":-0.09876883405951377,"y":0.015643446504023103,"size":10,"color":"#000"},{"id":6,"label":"{a0\u003dv1}","x":-0.08910065241883679,"y":0.04539904997395468,"size":10,"color":"#000"},{"id":7,"label":"{a0\u003dv1}","x":-0.07071067811865475,"y":0.07071067811865475,"size":10,"color":"#000"},{"id":8,"label":"{a0\u003dv1}","x":-0.045399049973954685,"y":0.08910065241883677,"size":10,"color":"#000"},{"id":9,"label":"{a0\u003dv2}","x":-0.0156434465040231,"y":0.09876883405951377,"size":10,"color":"#000"},{"id":10,"label":"{a0\u003dv1}","x":0.01564344650402307,"y":0.09876883405951378,"size":10,"color":"#000"},{"id":11,"label":"{a0\u003dv0}","x":0.04539904997395462,"y":0.08910065241883681,"size":10,"color":"#000"},{"id":12,"label":"{a0\u003dv1}","x":0.07071067811865475,"y":0.07071067811865477,"size":10,"color":"#000"},{"id":13,"label":"{a0\u003dv2}","x":0.08910065241883677,"y":0.04539904997395469,"size":10,"color":"#000"},{"id":14,"label":"{a0\u003dv2}","x":0.09876883405951377,"y":0.015643446504023103,"size":10,"color":"#000"},{"id":15,"label":"{a0\u003dv2}","x":0.09876883405951378,"y":-0.015643446504023068,"size":10,"color":"#000"},{"id":16,"label":"{a0\u003dv1}","x":0.0891006524188368,"y":-0.045399049973954664,"size":10,"color":"#000"},{"id":17,"label":"{a0\u003dv1}","x":0.07071067811865477,"y":-0.07071067811865474,"size":10,"color":"#000"},{"id":18,"label":"{a0\u003dv2}","x":0.0453990499739547,"y":-0.08910065241883677,"size":10,"color":"#000"},{"id":19,"label":"{a0\u003dv1}","x":0.015643446504023113,"y":-0.09876883405951377,"size":10,"color":"#000"}],"edges":[{"id":20,"label":"e0","source":0,"target":5,"size":10,"color":"#888"},{"id":21,"label":"e0","source":0,"target":9,"size":10,"color":"#888"},{"id":22,"label":"e0","source":1,"target":16,"size":10,"color":"#888"},{"id":23,"label":"e0","source":1,"target":3,"size":10,"color":"#888"},{"id":24,"label":"e0","source":2,"target":15,"size":10,"color":"#888"},{"id":25,"label":"e0","source":2,"target":10,"size":10,"color":"#888"},{"id":26,"label":"e0","source":3,"target":14,"size":10,"color":"#888"},{"id":27,"label":"e0","source":3,"target":4,"size":10,"color":"#888"},{"id":28,"label":"e0","source":4,"target":7,"size":10,"color":"#888"},{"id":29,"label":"e0","source":4,"target":14,"size":10,"color":"#888"},{"id":30,"label":"e0","source":5,"target":16,"size":10,"color":"#888"},{"id":31,"label":"e0","source":5,"target":18,"size":10,"color":"#888"},{"id":32,"label":"e0","source":6,"target":0,"size":10,"color":"#888"},{"id":33,"label":"e0","source":6,"target":19,"size":10,"color":"#888"},{"id":34,"label":"e0","source":7,"target":19,"size":10,"color":"#888"},{"id":35,"label":"e0","source":7,"target":11,"size":10,"color":"#888"},{"id":36,"label":"e0","source":8,"target":11,"size":10,"color":"#888"},{"id":37,"label":"e0","source":8,"target":10,"size":10,"color":"#888"},{"id":38,"label":"e0","source":9,"target":15,"size":10,"color":"#888"},{"id":39,"label":"e0","source":9,"target":16,"size":10,"color":"#888"},{"id":40,"label":"e0","source":10,"target":0,"size":10,"color":"#888"},{"id":41,"label":"e0","source":10,"target":14,"size":10,"color":"#888"},{"id":42,"label":"e0","source":11,"target":10,"size":10,"color":"#888"},{"id":43,"label":"e0","source":11,"target":3,"size":10,"color":"#888"},{"id":44,"label":"e0","source":12,"target":11,"size":10,"color":"#888"},{"id":45,"label":"e0","source":12,"target":12,"size":10,"color":"#888"},{"id":46,"label":"e0","source":13,"target":3,"size":10,"color":"#888"},{"id":47,"label":"e0","source":13,"target":4,"size":10,"color":"#888"},{"id":48,"label":"e0","source":14,"target":4,"size":10,"color":"#888"},{"id":49,"label":"e0","source":14,"target":17,"size":10,"color":"#888"},{"id":50,"label":"e0","source":15,"target":16,"size":10,"color":"#888"},{"id":51,"label":"e0","source":15,"target":4,"size":10,"color":"#888"},{"id":52,"label":"e0","source":16,"target":8,"size":10,"color":"#888"},{"id":53,"label":"e0","source":16,"target":5,"size":10,"color":"#888"},{"id":54,"label":"e0","source":17,"target":19,"size":10,"color":"#888"},{"id":55,"label":"e0","source":17,"target":1,"size":10,"color":"#888"},{"id":56,"label":"e0","source":18,"target":13,"size":10,"color":"#888"},{"id":57,"label":"e0","source":18,"target":16,"size":10,"color":"#888"},{"id":58,"label":"e0","source":19,"target":12,"size":10,"color":"#888"},{"id":59,"label":"e0","source":19,"target":14,"size":10,"color":"#888"}]} \ No newline at end of file diff --git a/src/test/java/org/fujaba/graphengine/unitTests/RoadworkExample.java b/src/test/java/org/fujaba/graphengine/unitTests/RoadworkExample.java index b2bb621..c10d5e7 100644 --- a/src/test/java/org/fujaba/graphengine/unitTests/RoadworkExample.java +++ b/src/test/java/org/fujaba/graphengine/unitTests/RoadworkExample.java @@ -379,16 +379,16 @@ private double testRoadworkExample(boolean debug, IsomorphismHandler ih, int fro public void testRoadworkExample() { ArrayList toTest = new ArrayList(); - //toTest.add(new IsomorphismHandlerParallel()); - //toTest.add(new IsomorphismHandlerCombinatorial()); - //toTest.add(new IsomorphismHandlerCSPHighHeuristics()); + toTest.add(new IsomorphismHandlerParallel()); + toTest.add(new IsomorphismHandlerCombinatorial()); + toTest.add(new IsomorphismHandlerCSPHighHeuristics()); toTest.add(new IsomorphismHandlerCSPLowHeuristics()); - //toTest.add(new IsomorphismHandlerDepthFirstBacktracking()); - //toTest.add(new IsomorphismHandlerSorting()); + toTest.add(new IsomorphismHandlerDepthFirstBacktracking()); + toTest.add(new IsomorphismHandlerSorting()); boolean debug = false; - int fromLevel = 3; - int toLevel = 3; + int fromLevel = 1; + int toLevel = 1; boolean drawSigmaJs = false; boolean drawAlchemyJs = false;