Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

batcher for performance improvements #12

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
Open

batcher for performance improvements #12

wants to merge 10 commits into from

Conversation

Topru333
Copy link
Member

@Topru333 Topru333 commented Sep 8, 2022

No description provided.

@Topru333 Topru333 requested a review from cordwelt September 8, 2022 10:28
@Topru333 Topru333 self-assigned this Sep 8, 2022
batcher.onMessage(message.toRawMessage(
connectionId,
direction,
(if (direction == Direction.FIRST) incomingSequence else outgoingSequence)()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(if (direction == Direction.FIRST) incomingSequence else outgoingSequence)()
(if (direction == Direction.FIRST) incomingSequence else outgoingSequence).invoke()

For readability


val batcher = RawMessageBatcher(settings.maxBatchSize, settings.maxFlushTime, {
it.metadataOrBuilder.id.direction
}, scheduledExecutorService, messageRouter::send).also {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

messageRouter::send

We've lost passing of attribute here

@@ -190,7 +208,9 @@ data class Settings(
val handlerSettings: IHandlerSettings? = null,
val grpcStartControl: Boolean = false,
val autoStart: Boolean = true,
val autoStopAfter: Int = 0
val autoStopAfter: Int = 0,
val maxBatchSize: Int = 100,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make it a 1000

@@ -1,5 +1,6 @@
kotlin.code.style=official
kotlin_version=1.4.10
release_version=0.3.1
slf4j_version=1.7.32
release_version=0.3.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump minor version instead since there was an extension of functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants