I am using Python3 to extract some information from a dictionary that contains 10k of CIDRs, but the running time is pretty long.Here is my purpose: I have a dictionary of CIDRs (10000) and a list of IPs (5000), then I want to go through each IP in the list and check if it belongs to one CIDR in the dictionary.Could you please give me some trick to reduce the running time?#python 3:import osimport ipaddressDict = {127.0.0.0/8 : ABC, 169.128.0.0/16 : DEF}List = {127.0.0.1, 126.1.1.1, 169.2.2.2, 150.0.22.2}for IP in List:  for CIDR in Dict.keys():    if ipaddress.ip_address(IP) in ipaddress.ip_network(CIDR):      print(CIDR)      break
Efficiently matching IP addresses with a list of CIDRs
python;performance;python 3.x