I have Python code that has lots of loops that consume data from Python generators. Some also re yield the processed data. This is a bottleneck and I want to speed this part up and was thinking of using Cython.
What is the recommended way to deal with generators and yield. I would like to
for
loops consume data produced by Python generatorsI would guess this is a common enough use case, what is the recommended ways to do this.
Some recommendations:
cython
and see what kind of speedup you get.We'll need more information about your goals and constraints to provide more help here. A stripped down example would be helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With