I have two large lists of tuples: "neg" (length ~40K) and "All" (length ~2M) whose proxies can be downloaded from the following link
ftp://ftp.lrz.de/transfer/List_Intersect/
I would like to search "neg" inside "All" and return the matched indices in "All". I tried the following solution which takes 788.1487 seconds on a fairly powerful pc (see specs below). Moreover, it doesn't retain the correct order.
https://stackoverflow.com/a/39500933/6524326
In fact, the following code does the required job in 202.6451 seconds. Can It be made even faster?
def findTupleIndices(smallList, bigList):
comList = sorted(set(smallList) & set(bigList), key=smallList.index)
idx = [bigList.index(x) for x in comList]
return(idx)
pc specs
Intel(R) Core(TM) i7-5930K CPU @ 3.50GHz, 32GB RAM DDR4-2133 MHz