I am new to PYPY and trying to use it with large arrays being worked on in a large iteration for loop. What libraries can I use to optimize for large arrays and are there any other optimizing techniques I should be aware of?
PLEASE NOTE THE *****SIMPLE CODE***** BELOW does not show that the print1-print10 variables CHANGE ON EVERY ITERATION. I am trying to keep things simple given that my question is ONLY about optimization techniques.
The code below is simple: 10 large arrays get merged in a for loop 28,000 times and all the numbers that fall out 3 times over all 10 arrays are calculated on every iteration. This is super slow, would take hours, to loop to 28000.
print1=range(0,200000)
print2=range(100000,325000)
print3=range(180000,300000)
print4=range(0,250000)
print5=range(0,100000)
print6=range(170000,300000)
print7=range(160000,300000)
print8=range(150000,300000)
print9=range(140000,300000)
print10=range(130000,300000)
task_id=0
for x in range(0, 28800):
print x
result= print1 + print2 + print3 + print4 + print5 + print6 + print7 + print8 + print9 + print10
from collections import Counter
countresult=Counter(result)
u = [ m for m,n in countresult.iteritems() if n == 3 ]
print str(u) + "this is countsum"