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

platform(fix): Improve performance of builder #9435

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

Swiftyos
Copy link
Contributor

@Swiftyos Swiftyos commented Feb 6, 2025

  1. Remove isHovered / onMouseEnter / onMouseLeave state updates
  2. Wrap Custom Node in React.memo
  3. Avoid re-renders for context menus

Copy link

supabase bot commented Feb 6, 2025

This pull request has been ignored for the connected project bgwpwdsxblryihinutbx because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

Copy link
Contributor

github-actions bot commented Feb 6, 2025

This PR targets the master branch but does not come from dev or a hotfix/* branch.

Automatically setting the base branch to dev.

@github-actions github-actions bot changed the base branch from master to dev February 6, 2025 10:59
@github-actions github-actions bot added platform/frontend AutoGPT Platform - Front end platform/backend AutoGPT Platform - Back end size/xl labels Feb 6, 2025
@Swiftyos Swiftyos changed the title platform platform(fix): Improve performance of builder Feb 6, 2025
Copy link

deepsource-io bot commented Feb 6, 2025

Here's the code health analysis summary for commits 8181ee8..e313ea7. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript✅ Success
❗ 38 occurences introduced
🎯 40 occurences resolved
View Check ↗
DeepSource Python LogoPython✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link

netlify bot commented Feb 6, 2025

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit e313ea7
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/67a495ee2dd9950008af13ec

@Swiftyos Swiftyos marked this pull request as ready for review February 6, 2025 11:00
@Swiftyos Swiftyos requested a review from a team as a code owner February 6, 2025 11:00
@Swiftyos Swiftyos requested review from aarushik93 and majdyz and removed request for a team February 6, 2025 11:00
Copy link

qodo-merge-pro bot commented Feb 6, 2025

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Performance Impact

The React.memo wrapper around CustomNode component uses a simple comparison that only checks if data prop changed. This may miss important prop changes and cause stale renders if other props like width, height or selected change.

export const CustomNode = React.memo(
  function CustomNode({
Incomplete Implementation

The handleContextMenu callback is empty and only prevents default behavior. Since it's marked as handling context menu events, it should either implement the menu functionality or be removed.

const handleContextMenu = useCallback(
  (e: React.MouseEvent<HTMLDivElement>) => {
    e.preventDefault();
    // Optionally, you can trigger a custom, lightweight context menu here.
  },
  [],
);

@Swiftyos Swiftyos requested a review from kcze February 6, 2025 11:23
@Swiftyos Swiftyos enabled auto-merge February 6, 2025 17:31
Copy link
Member

@ntindle ntindle left a comment

Choose a reason for hiding this comment

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

honestly better arch overall with dot too

@Swiftyos Swiftyos requested a review from kcze February 7, 2025 09:01
@Swiftyos Swiftyos dismissed kcze’s stale review February 7, 2025 09:02

Changes caused a 10% speed up for the tests

@Swiftyos Swiftyos added this pull request to the merge queue Feb 7, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 7, 2025
@Swiftyos Swiftyos merged commit c693875 into dev Feb 7, 2025
22 checks passed
@Swiftyos Swiftyos deleted the swiftyos/imporve-graph-performance branch February 7, 2025 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/backend AutoGPT Platform - Back end platform/frontend AutoGPT Platform - Front end Review effort [1-5]: 4 size/xl
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants