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

GitAuto: A performance of a page (/settings/integrations/jira) is too slow. #137

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

gitauto-for-dev[bot]
Copy link

Resolves #133

Why the bug occurs

The /settings/integrations/jira page is experiencing slow performance primarily due to several network-related issues:

  • Slow Fetch Requests: Critical API calls such as get-projects and get-user-info are taking over 1.7 seconds to respond, leading to delays in rendering necessary data on the page.
  • Pending Websocket Connections: Websocket requests are marked as pending, which may cause delays in establishing real-time data connections essential for the page's functionality.
  • High Overall Load Time: The total load time exceeds 5 seconds, with significant portions attributed to DOMContentLoaded and Load events, indicating inefficiencies in both frontend and backend processes.

How to reproduce

  1. Navigate to the /settings/integrations/jira page in the application.
  2. Open the browser's developer tools and go to the Network tab.
  3. Refresh the page and observe the network requests and their durations.
  4. Notice that fetch requests like get-projects and get-user-info take over 1.7 seconds each.
  5. Observe that some websocket connections remain pending, affecting real-time data updates.
  6. Verify that the total load time exceeds 5 seconds, impacting the overall user experience.

How to fix

To address the performance issues on the /settings/integrations/jira page, the following steps should be taken:

  1. Optimize API Endpoints:

    • Backend Improvements: Review and optimize the get-projects and get-user-info API endpoints to reduce response times. This may involve query optimization, indexing databases, or implementing more efficient algorithms.
    • Caching Strategies: Implement caching mechanisms for frequently accessed data to minimize redundant server calls and speed up data retrieval.
  2. Enhance Websocket Handling:

    • Connection Stability: Investigate why websocket connections are pending and ensure that the server can handle websocket requests efficiently. This might involve scaling websocket servers or optimizing handshake processes.
    • Fallback Mechanisms: Implement fallback strategies for scenarios where websocket connections fail or take too long, ensuring that essential data can still be fetched via alternative methods.
  3. Frontend Performance Optimization:

    • Lazy Loading: Implement lazy loading for components and data that are not immediately necessary during the initial page load.
    • Code Splitting: Use code splitting techniques to reduce the size of JavaScript bundles, allowing faster loading and rendering of the page.
    • Minimize Render Blocking: Ensure that critical rendering paths are optimized by minimizing render-blocking resources such as large scripts or stylesheets.
  4. Monitoring and Instrumentation:

    • Performance Monitoring: Utilize tools and libraries within instrumentation.ts to monitor API performance and identify bottlenecks in real-time.
    • Logging Enhancements: Enhance logging mechanisms to capture detailed performance metrics, aiding in quicker diagnosis and resolution of future performance issues.
  5. Review and Refactor Code:

    • Identify Inefficiencies: Conduct a thorough code review of the components and utilities within the app and components directories to identify and refactor inefficient code patterns.
    • Optimize Data Handling: Ensure that state management and data fetching logic are optimized to prevent unnecessary re-renders and data processing delays.

By implementing these fixes, the performance of the /settings/integrations/jira page should improve significantly, resulting in a smoother and more responsive user experience.

Test these changes locally

git checkout -b gitauto-wes/issue-133-20241214-145200
git pull origin gitauto-wes/issue-133-20241214-145200

Copy link

vercel bot commented Dec 14, 2024

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

Name Status Preview Comments Updated (UTC)
gitauto-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 14, 2024 6:00am

Copy link
Author

gitauto-for-dev bot commented Dec 14, 2024

Committed the Check Run take-screenshots error fix! Running it again...

Copy link

gitauto.ai%2F

Before (main) After (this branch)

Copy link

gitauto.ai%2Fblog

Before (main) After (this branch)

Copy link

gitauto.ai%2Fsettings%2Fintegrations%2Fjira

Before (main) After (this branch)

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.

0 participants