# The way of kings: efficiency of generators

**URL:** <https://discourse.julialang.org/t/the-way-of-kings-efficiency-of-generators/6854>\
**Category:** New to Julia\
**Tags:** question, performance, python, puzzles\
**Created:** [November 3, 2017, 7:06am UTC](https://discourse.julialang.org/t/the-way-of-kings-efficiency-of-generators/6854 "2017-11-03T07:06:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liso](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@Liso](https://discourse.julialang.org/u/Liso)\
**Post date:** [November 3, 2017, 7:06am UTC](https://discourse.julialang.org/t/the-way-of-kings-efficiency-of-generators/6854/1 "2017-11-03T07:06:09Z")

</div>

Hello! 🙂

I asked rather provocative [question on SO](https://stackoverflow.com/questions/47090023/julia-the-way-of-kings-generator-performance) about generators.

I would like to get attention of the people who knows about julia’s generators more… 😛

If it could be possible I would also like to help improve julia… 🙂

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [November 3, 2017, 3:26pm UTC](https://discourse.julialang.org/t/the-way-of-kings-efficiency-of-generators/6854/2 "2017-11-03T15:26:58Z")

</div>

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.
