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. #138

Open
wants to merge 3 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 performance issues because the APIs /api/jira/get-projects and /api/github/get-installed-repos are being called multiple times. Specifically, both APIs are invoked twice in quick succession, leading to redundant network requests and slowing down the page load time.

How to reproduce

  1. Navigate to the /settings/integrations/jira page.
  2. Open the browser's network console.
  3. Observe that the /api/jira/get-projects endpoint is called twice in a row.
  4. Simultaneously, the /api/github/get-installed-repos endpoint is also called twice.

How to fix

  • Debounce API Calls: Ensure that the API calls to /api/jira/get-projects and /api/github/get-installed-repos are not triggered multiple times unnecessarily. Implement debounce mechanisms to limit the frequency of these calls.

  • Optimize Component Rendering: Investigate if the components responsible for these API calls are re-rendering more often than necessary. Utilize techniques like React.memo or useMemo to prevent unnecessary re-renders.

  • Consolidate API Requests: If possible, combine multiple API requests into a single call to reduce the number of network requests.

  • Review UseEffect Dependencies: Ensure that the dependencies in useEffect hooks (if using React) are correctly set to prevent repeated executions of the API calls.

Implementing these changes should reduce the number of redundant API calls, thereby improving the page's performance.

Test these changes locally

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

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 ❌ Failed (Inspect) Dec 14, 2024 6:12am

Copy link
Author

gitauto-for-dev bot commented Dec 14, 2024

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

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