Massive src-address filtering per C-VLAN

I have to setup a switch that will handle hundreds (possibly one thousand) of C-VLANs inside a couple of S-VLANs.

For each C-VLAN I have to set a filter rule to drop frames that don’t have the correct SRC IP Address for that C-VLAN.

The problem here is that if there are one thousand of C-VLANs then there will be one thousand of filter rules, and I don’t want that every packet “traverses” on average half thousand of rules before it encounters the rule that pertain its C-VLAN.

Can anybody suggest me the most efficient way to achieve this?

Thanks.