Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spread in Map and Set literals should use .of constructor and addAll methods #49307

Closed
rakudrama opened this issue Jun 21, 2022 · 0 comments
Closed
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. front-end-kernel-transformation P3 A lower priority bug or feature request

Comments

@rakudrama
Copy link
Member

The current lowering of {...a, ...a} has two loops.
This would be better for code size if lowered to Map.of(a)..addAll(a) or Set.of(a)..addAll(a).
We already do this for List (#44188).

The VM implementation of Map.of / Map.addAll has a fast path when the argument is also the default Map implementation.
This is potentially faster than the current loop.

@rakudrama rakudrama added area-front-end Use area-front-end for front end / CFE / kernel format related issues. front-end-kernel-transformation labels Jun 21, 2022
@johnniwinther johnniwinther added the P3 A lower priority bug or feature request label Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. front-end-kernel-transformation P3 A lower priority bug or feature request
Projects
None yet
Development

No branches or pull requests

3 participants