`1.dart`: fix `Stream` and `yield` usage
The previous code was using yield in a wrong (or outdated) form, creating unnecessary Future + lambda and unnecessary use of await.
Without this fix the Dart benchmark status is timeout, BTW.
See my comment on line 18, don't over-optimize it.
Without this fix the Dart benchmark status is timeout, BTW.
What perf gain did u see? I see negligible number difference with this change locally
I can change to yield await Future.value(i);, since it's almost the same execution time.
The main point here is that this is not an over optimization. yield I; is the simpler version, and return a Future.value here is the unnecessary optimization. In Dart 2.18 the compiler won't schedule a micro task if you return a Future.value, in other words it will have the exact same behavior of yield I;.
Let me know what approach do you prefer. Regards.