Skip to content

⚡ Bolt: [performance improvement]#63

Open
bobdivx wants to merge 1 commit into
devfrom
bolt-performance-work-overview-2367311465919978970
Open

⚡ Bolt: [performance improvement]#63
bobdivx wants to merge 1 commit into
devfrom
bolt-performance-work-overview-2367311465919978970

Conversation

@bobdivx
Copy link
Copy Markdown
Owner

@bobdivx bobdivx commented May 25, 2026

💡 What: Parallelized database queries using Promise.all in work-overview.ts
🎯 Why: Resolves sequential fetching bottleneck to improve endpoint response time
📊 Impact: Reduces total query wait time to the longest single query
🔬 Measurement: Run pnpm test and verify endpoint latency


PR created automatically by Jules for task 2367311465919978970 started by @bobdivx

Co-authored-by: bobdivx <6737167+bobdivx@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
forge Ready Ready Preview, Comment May 25, 2026 5:15pm

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request optimizes the GET endpoint in work-overview.ts by parallelizing independent database queries using Promise.all to reduce total wait time, alongside minor code formatting updates. The reviewer suggests further optimizing performance by selecting only the required columns instead of fetching entire rows, which would reduce database I/O, network payload size, and memory usage.

Comment on lines +133 to +148
const [projectRows, issues, taskRows, requestRows, depRows] =
await Promise.all([
db.select().from(Project),
db
.select()
.from(AgentAppIssue)
.orderBy(desc(AgentAppIssue.createdAt))
.limit(400),
db.select().from(AgentTask).limit(1200),
db.select().from(Request).orderBy(desc(Request.createdAt)).limit(200),
db
.select()
.from(AgentDependencyRequest)
.orderBy(desc(AgentDependencyRequest.createdAt))
.limit(120),
]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To further optimize the performance of this endpoint, consider selecting only the required columns instead of fetching entire rows. Currently, tables like AgentTask and AgentAppIssue contain potentially large text columns (such as output and detail) that are completely unused in this endpoint. Selecting only the necessary columns will reduce database I/O, network payload size, and memory usage.

    const [projectRows, issues, taskRows, requestRows, depRows] =
      await Promise.all([
        db
          .select({
            id: Project.id,
            name: Project.name,
            swarmEnabled: Project.swarmEnabled,
          })
          .from(Project),
        db
          .select({
            id: AgentAppIssue.id,
            projectId: AgentAppIssue.projectId,
            url: AgentAppIssue.url,
            errorType: AgentAppIssue.errorType,
            title: AgentAppIssue.title,
            status: AgentAppIssue.status,
            reportedByAgentId: AgentAppIssue.reportedByAgentId,
            assigneeAgentId: AgentAppIssue.assigneeAgentId,
            createdAt: AgentAppIssue.createdAt,
            updatedAt: AgentAppIssue.updatedAt,
          })
          .from(AgentAppIssue)
          .orderBy(desc(AgentAppIssue.createdAt))
          .limit(400),
        db
          .select({
            id: AgentTask.id,
            agentId: AgentTask.agentId,
            task: AgentTask.task,
            input: AgentTask.input,
            status: AgentTask.status,
            updatedAt: AgentTask.updatedAt,
          })
          .from(AgentTask)
          .limit(1200),
        db
          .select({
            id: Request.id,
            projectId: Request.projectId,
            title: Request.title,
            content: Request.content,
            status: Request.status,
            priority: Request.priority,
            author: Request.author,
            requestType: Request.requestType,
            assigneeAgentId: Request.assigneeAgentId,
            createdAt: Request.createdAt,
          })
          .from(Request)
          .orderBy(desc(Request.createdAt))
          .limit(200),
        db
          .select({
            id: AgentDependencyRequest.id,
            projectId: AgentDependencyRequest.projectId,
            packageName: AgentDependencyRequest.packageName,
            versionSpec: AgentDependencyRequest.versionSpec,
            status: AgentDependencyRequest.status,
            requestedByAgentId: AgentDependencyRequest.requestedByAgentId,
            createdAt: AgentDependencyRequest.createdAt,
          })
          .from(AgentDependencyRequest)
          .orderBy(desc(AgentDependencyRequest.createdAt))
          .limit(120),
      ]);

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.

1 participant