f4dfb76ea1
Add docs about performance and `Iterator::map` to `[T; N]::map` This suboptimal code gen for some usages of array::map got a bit of attention by multiple people throughout the community. Some cases: - https://github.com/rust-lang/rust/issues/75243#issuecomment-866051086 - https://github.com/rust-lang/rust/issues/75243#issuecomment-874732134 - https://www.reddit.com/r/rust/comments/oeqqf7/unexpected_high_stack_usage/ My *guess* is that this gets the attention it gets because in JavaScript (and potentially other languages), a `map` function on arrays is very commonly used since in those languages, arrays basically take the role of Rust's iterator. I considered explicitly naming JavaScript in the first paragraph I added, but I couldn't find precedence of mentioning other languages in standard library doc, so I didn't add it. When array::map was stabilized, we still wanted to add docs, but that somehow did not happen in time. So here we are. Not sure if this sounds crazy but maybe it is worth considering beta backporting this? Only if it's not a lot of work, of course! But yeah, stabilized array::map is already in beta and if this problem is really as big as it sometimes seems, might be worth having the docs in place when 1.55 is released. CC ``@CryZe`` r? ``@m-ou-se`` (since you were involved in that discussion and the stabilization) |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
Cargo.toml |