From 9b47bcaf53545fa50df5610fc5e28850fb766abe Mon Sep 17 00:00:00 2001 From: ishland Date: Sat, 31 Aug 2024 16:06:43 +0800 Subject: [PATCH] perf: get slightly more from parallel scheduling --- .../ishland/flowsched/scheduler/StatusAdvancingScheduler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ishland/flowsched/scheduler/StatusAdvancingScheduler.java b/src/main/java/com/ishland/flowsched/scheduler/StatusAdvancingScheduler.java index e7b5a8a..7c842a0 100644 --- a/src/main/java/com/ishland/flowsched/scheduler/StatusAdvancingScheduler.java +++ b/src/main/java/com/ishland/flowsched/scheduler/StatusAdvancingScheduler.java @@ -135,8 +135,8 @@ public boolean tick() { continue; } if (nextStatus == current) { - holder.cleanupDependencies(this); if (current.equals(getUnloadedStatus())) { + holder.cleanupDependencies(this); // System.out.println("Unloaded: " + key); this.onItemRemoval(holder); holder.release(); @@ -148,6 +148,7 @@ public boolean tick() { } continue; } + holder.submitOp(CompletableFuture.runAsync(() -> holder.cleanupDependencies(this), getBackgroundExecutor())); continue; // No need to update } if (current.ordinal() < nextStatus.ordinal()) {