Skip to content

[ENHANCEMENT] Performance Optimization: Reduce API Calls and Improve Load TimesΒ #130

@akash2017sky

Description

@akash2017sky

Description:

The application makes excessive API calls that impact performance, especially on initial load and when navigating between pages. Multiple sequential API requests create waterfall loading patterns that slow down the user experience.

Performance Issues Identified:

  1. Redundant API Calls on Tab Switches
  • Location: WalletTransactionLog.tsx, FeedList.tsx
  • Issue: Fetching data again when switching between All/Sent/Received tabs
  • Impact: Unnecessary network requests, slower UI response
  1. Sequential User/Wallet/Transaction Fetching
  • Location: FeedList.tsx:59-105
  • Issue: Nested loops fetching users β†’ wallets β†’ transactions sequentially
  • Impact: Long loading times when many users exist (N+1 query pattern)
  1. No Request Caching
  • Issue: Same data fetched multiple times across components
  • Impact: Increased bandwidth usage, slower page loads
  1. Missing Data Pagination
  • Location: FeedList.tsx:24 (hardcoded MAX_RECORDS = 100)
  • Issue: Loading all records upfront instead of on-demand
  • Impact: Initial load time increases with data growth

Proposed Solutions:

  1. Implement Client-Side Caching βœ… (Partially implemented)
  • Cache fetched data in component state
  • Filter cached data instead of re-fetching
  1. Add Request Batching
  • Batch multiple API calls into single requests where possible
  • Use Promise.all() for parallel requests instead of sequential
  1. Implement React Query or SWR
  • Automatic caching, background refetching
  • Deduplicate simultaneous requests
  • Better loading/error states management
  1. Add Virtualization for Long Lists
  • Use react-window or react-virtual for feed lists
  • Only render visible items
  1. Implement Pagination/Infinite Scroll
  • Load data in chunks (e.g., 20 items at a time)
  • Add "Load More" button or infinite scroll
  1. Add Loading Skeletons
  • Replace "Loading..." text with skeleton screens
  • Improve perceived performance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions