Skip to content

Conversation

@prashantrahul141
Copy link
Contributor

fixes #55063

Use foreach loop instead of for loop in array's append! due to it being type-stable.

@LilithHafner LilithHafner merged commit 159424f into JuliaLang:master Mar 16, 2025
7 checks passed
@LilithHafner
Copy link
Member

Thanks, @prashantrahul141, and welcome! A lovely PR.

@LilithHafner LilithHafner added the performance Must go faster label Mar 16, 2025
@adienes
Copy link
Member

adienes commented Mar 16, 2025

with this merged, I would suggest #51395 really needs to become a priority as now Base implicitly assumes that foreach operates in iteration order. which seems fine to me, but it should be codified / documented

@LilithHafner
Copy link
Member

While I agree that we should handle #51395, it is okay for Base to depend on its own undocumented internals so this doesn't add much to #51395's urgency.

@prashantrahul141 prashantrahul141 deleted the fix-use-foreach-in-array-append branch March 16, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Must go faster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

For-Loop Type Instability in the Base Library

3 participants