optimization - How to speed up simple loop in python -
i want accelerate speed of loop in python. there code below.
for x in dpath.util.search(self.data, "**", yielded=true): self.contentslist.append(x)
dpath.util.search generator. how speed simple loop??
well, loop unnecessary; let python looping & append work single function call instead of many calls with:
self.contentslist.extend(dpath.util.search(self.data, "**", yielded=true))
Comments
Post a Comment