File tree Expand file tree Collapse file tree 3 files changed +12
-14
lines changed Expand file tree Collapse file tree 3 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ class QueryRunner constructor(
108108 const val MATCH_GROUP_AGGREGATE_QUERY_NO_RESULT =
109109 " Match Group Aggregate query did not match any concept groups to aggregate in the database."
110110
111- private const val COUNT_DOWN_LATCH_PERIOD_MS : Long = 10
111+ private const val COUNT_DOWN_LATCH_PERIOD_MS : Long = 50
112112 private val RUNNING_INDICATOR_DELAY = Duration .seconds(3 )
113113 private val LOGGER = KotlinLogging .logger {}
114114 }
@@ -180,7 +180,7 @@ class QueryRunner constructor(
180180 if (! hasStopSignal.get()) {
181181 do {
182182 isConsumed = consumerLatch.count == 0L
183- delay(COUNT_DOWN_LATCH_PERIOD_MS )
183+ if ( ! isConsumed) delay(COUNT_DOWN_LATCH_PERIOD_MS )
184184 } while (! isConsumed && ! hasStopSignal.get())
185185 }
186186 onComplete()
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ class GraphArea(transactionState: TransactionState) {
154154 edgeLabelSizes[edge.label]?.let { viewport.rectIsVisible(edge.geometry.labelRect(it, density)) } ? : false
155155 }.let {
156156 // Ensure smooth performance during initial explosion
157- if (it.size < 100 || graph.physics.alpha < 0.25 ) it.toSet() else emptySet()
157+ if (it.size < 200 || graph.physics.alpha < 0.5 ) it.toSet() else emptySet()
158158 }
159159 }
160160
@@ -194,7 +194,7 @@ class GraphArea(transactionState: TransactionState) {
194194 val vertices = graph.vertices.filter { viewport.rectIsVisible(it.geometry.rect) }
195195 Canvas (Modifier .fillMaxSize()) { vertices.forEach { drawVertexBackground(it) } }
196196 // Ensure smooth performance when zoomed out, and during initial explosion
197- if (viewport.scale > 0.2 && (vertices.size < 100 || graph.physics.alpha < 0.25 )) {
197+ if (viewport.scale > 0.2 && (vertices.size < 200 || graph.physics.alpha < 0.5 )) {
198198 vertices.forEach { VertexLabel (it, it.geometry.position) }
199199 }
200200 }
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ import kotlinx.coroutines.CoroutineScope
4343import kotlinx.coroutines.Dispatchers
4444import kotlinx.coroutines.delay
4545import mu.KotlinLogging
46+ import java.util.concurrent.TimeUnit.MILLISECONDS
4647
4748internal class RunOutputGroup constructor(
4849 private val runner : QueryRunner ,
@@ -66,16 +67,14 @@ internal class RunOutputGroup constructor(
6667
6768 companion object {
6869 private const val CONSUMER_PERIOD_MS = 33 // 30 FPS
69- private const val COUNT_DOWN_LATCH_PERIOD_MS : Long = 10
70+ private const val COUNT_DOWN_LATCH_PERIOD_MS : Long = 50
7071 private val LOGGER = KotlinLogging .logger {}
7172
7273 private suspend fun <E > LinkedBlockingQueue<E>.takeNonBlocking (periodMS : Long ): E {
73- var item: E
74- do {
75- item = this .poll()
76- delay(periodMS)
77- } while (item == null )
78- return item
74+ while (true ) {
75+ val item = this .poll(1 , MILLISECONDS )
76+ if (item != null ) return item else delay(periodMS)
77+ }
7978 }
8079 }
8180
@@ -122,10 +121,9 @@ internal class RunOutputGroup constructor(
122121 }
123122
124123 private fun concludeRunnerIsConsumed () = coroutineScope.launchAndHandle(GlobalState .notification, LOGGER ) {
125- do {
126- val isConsumed = futuresLatch.count == 0L
124+ while (futuresLatch.count > 0L ) {
127125 delay(COUNT_DOWN_LATCH_PERIOD_MS )
128- } while ( ! isConsumed)
126+ }
129127 runner.setConsumed()
130128 endTime = System .currentTimeMillis()
131129 }
You can’t perform that action at this time.
0 commit comments