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

perf(shuttle): Trim stream at regular intervals instead of every iteration #2185

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

sds
Copy link
Member

@sds sds commented Jul 15, 2024

Why is this change needed?

Performance profiling indicates that we're spending a non-trivial amount of time (5-10% of wall clock time) trimming the stream. This doesn't need to happen as frequently as it's currently happening, so switch to an interval timer so that we're not slowing down general processing in any meaningful way.

Merge Checklist


PR-Codex overview

This PR optimizes the event stream processing in HubEventStreamConsumer by adding a regular interval to trim old events efficiently.

Detailed summary

  • Added interval property to schedule event processing at regular intervals
  • Implemented interval logic to clear old events and process stale events
  • Updated stop method to clear the interval
  • Simplified event processing logic in the message loop

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

…ation

Performance profiling indicates that we're spending a non-trivial amount
of time (5-10% of wall clock time) trimming the stream. This doesn't
need to happen as frequently as it's currently happening, so switch to
an interval timer so that we're not slowing down general processing in
any meaningful way.
Copy link

vercel bot commented Jul 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hub-monorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 15, 2024 7:21pm

Copy link

changeset-bot bot commented Jul 15, 2024

🦋 Changeset detected

Latest commit: b0905ab

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@farcaster/shuttle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@sds sds added the t-perf Improve performance label Jul 15, 2024
@sds sds enabled auto-merge (squash) July 15, 2024 19:21
@sds sds merged commit e5760da into main Jul 15, 2024
8 checks passed
@sds sds deleted the sds/interval-trim branch July 15, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-perf Improve performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant