I have scenario, where I got stream and I need to check for some value. If I got any new value I have to store it in any of data structure.
It seems very easy, I can place conditional statement if-else or can use contain method of set/map to check either received is new or not.
But the problem is checking will effect my application performance, in stream I will receive hundreds for value in second, if I start checking each and every value I received then for sure it effect performance.
Anybody can suggest me any mechanism or algorithm to solve my issue, either by bypassing checks or at least minimize them?