Skip to content

[PERFORMANCE] API Flooding on Navbar Global Search Component due to Missing Input Debouncing #667

@shivani11jadhav

Description

@shivani11jadhav

Description

Inside the global navigation or resource database search components, as a user types characters into the search field to find a specific resource or course, a state change/API re-fetch logic fires instantly on every single keystroke. This causes massive layout lag on low-end devices and triggers hundreds of redundant network calls/computational filter cycles within a few seconds of typing.

Steps to Reproduce

  1. Focus on the platform search input field.
  2. Open Developer Tools (F12) -> Network tab.
  3. Fast-type a search string (e.g., "Fullstack Developer Roadmap").
  4. Notice that an individual API filter or intensive local array sorting operation runs for "F", "Fu", "Ful", "Full", etc., flooding the pipeline with unnecessary executions.

Technical Analysis & Solution

The search handler updates local state variables directly on the text input’s onChange event listener without handling delay thresholds.

  • Fix: I will implement an optimized custom useDebounce hook or wrap the handler function in a 300ms window delay using clean client-side hooks.
  • Result: The system will wait for the user to briefly pause typing before firing the computational sort or network query, making the platform feel incredibly snappy and production-optimized.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions