AndWass / pushgen

Apache License 2.0
27 stars 4 forks source link

Add `from_fn` generator factory #26

Closed epage closed 3 years ago

epage commented 3 years ago

pushgen::from_fn mirrors std::iter::from_fn. The struct lives with the others in pushgen::structs::FromFn.

epage commented 3 years ago

After reading about this, I was curious to give it a try in a "real world" application (typos), so I'm adding support for what I need to start running benchmarks.

AndWass commented 3 years ago

Looks very nice! Thank you!

epage commented 3 years ago

Finally wrapped up my pushgen experiment: https://epage.github.io/blog/2021/07/pushgen-experiment/ (reddit).

AndWass commented 3 years ago

Nice! Thank you for trying it out!

Just for my own understanding, you saw some decent improvements when comparing iterator code vs pushgen specifically but in the use-case of typos it isn't where the real bottleneck is (IO etc is much slower)?