-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
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:
- 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
- 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)
- No Request Caching
- Issue: Same data fetched multiple times across components
- Impact: Increased bandwidth usage, slower page loads
- 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:
- Implement Client-Side Caching β (Partially implemented)
- Cache fetched data in component state
- Filter cached data instead of re-fetching
- Add Request Batching
- Batch multiple API calls into single requests where possible
- Use Promise.all() for parallel requests instead of sequential
- Implement React Query or SWR
- Automatic caching, background refetching
- Deduplicate simultaneous requests
- Better loading/error states management
- Add Virtualization for Long Lists
- Use react-window or react-virtual for feed lists
- Only render visible items
- Implement Pagination/Infinite Scroll
- Load data in chunks (e.g., 20 items at a time)
- Add "Load More" button or infinite scroll
- Add Loading Skeletons
- Replace "Loading..." text with skeleton screens
- Improve perceived performance
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels