Skip to content

perf(paymaster): batch subscription check over workspaces#550

Open
Kuchizu wants to merge 4 commits intomasterfrom
perf/paymaster-subscription-check
Open

perf(paymaster): batch subscription check over workspaces#550
Kuchizu wants to merge 4 commits intomasterfrom
perf/paymaster-subscription-check

Conversation

@Kuchizu
Copy link
Copy Markdown
Member

@Kuchizu Kuchizu commented May 6, 2026

Replaces find({}).toArray() over hawk.workspaces with a projected cursor processed in batches of 25. fetchPlans gets a projection too.

Comment thread workers/paymaster/src/index.ts Outdated
neSpecc
neSpecc previously approved these changes May 6, 2026
e11sy
e11sy previously approved these changes May 6, 2026
Comment thread workers/paymaster/src/index.ts Outdated
Comment on lines +240 to +243
const current = batch;

batch = [];
await Promise.all(current.map((workspace) => this.processWorkspaceSubscriptionCheck(workspace)));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
const current = batch;
batch = [];
await Promise.all(current.map((workspace) => this.processWorkspaceSubscriptionCheck(workspace)));
await Promise.all(batch.map((workspace) => this.processWorkspaceSubscriptionCheck(workspace)));
batch = [];

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

Comment thread workers/paymaster/src/index.ts Outdated
.filter(workspace => {
let batch: WorkspaceDBScheme[] = [];

const flush = async (): Promise<void> => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

for less confusion lets pass the batch into the method, not inherit from the context

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ok

@Kuchizu Kuchizu dismissed stale reviews from e11sy and neSpecc via e5ea73e May 8, 2026 01:49
@Kuchizu Kuchizu requested review from e11sy and neSpecc May 8, 2026 01:49
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