Debouncing :
typing slow = 200ms type fast = 30ms
Performances :
- iphone pro max = 14 letter's * 1000 = 14,000
- with debouncing = 3 API Calls * 1000 = 3000
Debouncing with 200ms
- if difference between 2 key strokes is "200ms" - Decline the api call <200ms make an api call (migh need suggestions)
Cache : time complexity to search in the array = 0(n); time complexity to search in object = 0(1);
array.indexOf();
[i, ip, iph, ipho, iphon, iphone]
new Map();
Understood the Web socket and API Polling concept and applying in my app