The way of kings: efficiency of generators

Not much optimization work has been done for this kind of usage of generators because if you really care about high performance you wouldn’t use generators like this in the first place. It would be nice to eventually make this faster, but it’s not a super high priority. I would recommend writing this in terms of straightforward iteration and recursion to get better performance.

4 Likes