I am creating a ReactJS app. The app has over 100,000 entities on screen which I am plotting using WebGL. The properties of these entirties are stored in a JSON/Dict type object. Whenever a user applies a filter, I need to go through the values, compare the properties, and select the ID (type UUID4) of those not matching the filter, so that I can turn their Visibility to False in the WebGL container.
I am presently using an Array of the following type :-
spriteProps = [ {id: xxxx-...-xxxx, color: Blue, Length: 10, points:50}, {id: yyyy-...-yyyy, color:Red, Length:25, points:112}, ..... ]
The user may want to see all entities which are Blue in color and have a length less than 100. So I have to iterate through each value and check which values match the filter. However, this is very slow.
What is the best data structure to use in this situation to get the best performance? Is there any JS library I can use to improve performance?
Thanks.