[ci skip] document that multiple yield
in inline iterator cause code bloat
#10553
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
yield
in inline iterator cause code bloatit's probably by design and not a bug but should be documented as it's a gotcha; see example below:
/cc @Araq
generates with
--embedsrc -d:release
:links
os.parentDirs
was deemed unsuitable in compiler/packagehandling.nim which had to roll it's own version:yield
to a singleyield
, see this PR: [TODO] os.parentDirs now uses a single yield to avoid code bloat; refs #10553 #10557note
inline
iterator in terms of having 0 overhead, while avoiding the code bloat associated with it (hence would likely be faster when instruction cache starts becoming a bottleneck because of resulting code bloat)concept
to avoid its bugs, see chaining of procs with concepts yieldsError: too nested for type matching
or exponential compile time #9422 (comment))