我有这个循环:
start = datetime.now()
for entry in entries:
related_entries = Related.objects.filter(entry_id=entry.entry_id, status='Related')
lead_related_entries.append({'Entry': entry, 'related_entries': related_entries})
end = datetime.now()
print (end - start)
我有近 7000 多个执行时间的条目:
0:00:10.377000
有什么任务可以让它更快吗?