Roiocam commented on code in PR #199: URL: https://github.com/apache/pekko-persistence-jdbc/pull/199#discussion_r1618041780
########## core/src/main/scala/org/apache/pekko/persistence/jdbc/query/scaladsl/JdbcReadJournal.scala: ########## @@ -119,7 +117,9 @@ class JdbcReadJournal(config: Config, configPath: String)(implicit val system: E override def persistenceIds(): Source[String, NotUsed] = Source .repeat(0) - .flatMapConcat(_ => delaySource.flatMapConcat(_ => currentPersistenceIds())) Review Comment: Under the throttle of this PR, the actual number of db executions is mostly about 10x times. ``` execute query, total count: 10 2024-05-29 08:52:18,885 - org.apache.pekko.actor.CoordinatedShutdown -> INFO [test-pekko.actor.default-dispatcher-5] [ test CoordinatedShutdown - Running CoordinatedShutdown with reason [ActorSystemTerminateReason] execute query, total count: 11 2024-05-29 08:53:01,234 - org.apache.pekko.actor.CoordinatedShutdown -> INFO [test-pekko.actor.default-dispatcher-5] [ test CoordinatedShutdown - Running CoordinatedShutdown with reason [ActorSystemTerminateReason] ``` However, in the original delaySource, most of the db executions were about more than 1,000 times, about 100x times that of the new approach. I guess the original way didn't limit the flow. ``` execute query, total count: 1042 2024-05-29 08:53:40,691 - org.apache.pekko.actor.CoordinatedShutdown -> INFO [test-pekko.actor.default-dispatcher-4] [ test CoordinatedShutdown - Running CoordinatedShutdown with reason [ActorSystemTerminateReason] execute query, total count: 1316 2024-05-29 08:55:42,865 - org.apache.pekko.actor.CoordinatedShutdown -> INFO [test-pekko.actor.default-dispatcher-6] [ test CoordinatedShutdown - Running CoordinatedShutdown with reason [ActorSystemTerminateReason] ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org For additional commands, e-mail: notifications-h...@pekko.apache.org