I have a list (inst_list) that consists of 20k elements and an input file (netlistFile) that is roughly 20k lines. Right now I have written two for loops where for each element in the list I search the input file. However, this is taking about 16 minutes to run because of the size of both files.
My coding abilities are very low, so there must be a faster way of doing it. Below is my code:
for x in inst_list:
count = 0
for line in fileinput.input(netlistFile):
if re.search(x,line) and count != 1:
#print line
line_split = line.split(" ")
cell_list.append(line_split[3])
count = 1
Thanks
The easiest fix was to just switch the loops like @Eevee suggested in the comments.