First, structuring your code in different ways can increase speed without the added complexity of streaming.
def doWork(session, res, RefHashList):
for equipment in res['Response']['data']['items']:
i = equipment['itemHash']
k = equipment['characterIndex']
if i in RefHashList and k != 0:
SendJsonViaSession(session, getCharacterIdFromIndex(res, k), i, equipment['quantity'])
equipment['itemHash'] equipment['characterIndex'] .
RefHashList in. Python, .
if -conditional, and.
. List res. , , , , .
-, ? SendJsonViaSession , ? , , .
-, Python , - Python. , .
Edit:
Python . multiprocessing.Pool, , multiprocessing.dummy.ThreadPool, . Python 3.2 concurrent.futures, .
, . , .
, SendJsonViaSession, , . , .
Edit2:
SendJsonViaSession 0,3 , 3 / . 1 /. , - . profile , , .