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

feat(tools):Cache logs player #614

Merged
merged 1 commit into from
Dec 28, 2022
Merged

feat(tools):Cache logs player #614

merged 1 commit into from
Dec 28, 2022

Conversation

ashotland
Copy link
Contributor

Signed-off-by: ashotland [email protected]

@ashotland ashotland enabled auto-merge (squash) December 28, 2022 11:26
Comment on lines +76 to +80
cmd = await asyncio.wait_for(self.queue.get(), timeout=1.0)
batch.append(cmd)
if len(batch) >= self.BATCH_SIZE:
await self.execute(batch)
batch.clear()
Copy link
Contributor

Choose a reason for hiding this comment

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

If you group the values on the producer side instead and send them over the channel in batches you would reduce the pressure on the asyncio scheduler

But I suspect its not a bottleneck here, besides managing the timeout to send half filled batches from the producer would be a little inconvenient

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dranikpg thanks, good feedback.

@ashotland ashotland merged commit 5638f65 into dragonflydb:main Dec 28, 2022
elif operation == 'cas':
cmd.args = ["SET", key, synthetic_value]
elif operation == 'append':
cmd.args = ["SET", key, synthetic_value]
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ashotland redis has append I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, will fix.

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.

3 participants