Skip to content

Conversation

@Connormiha
Copy link
Contributor

I did a little optimization .map + flat can be replaced by single flatMap.

@bpasero
Copy link
Member

bpasero commented Sep 25, 2023

Assigning to the using-new-JS-features-authority ;)

@jrieken
Copy link
Member

jrieken commented Sep 25, 2023

Generally this can be used but AFAIK know (and the last time we checked) it is significant slower

@jrieken
Copy link
Member

jrieken commented Sep 25, 2023

AFAIK know (and the last time we checked) it is significant slower

I might be mistaken and confuse it with Array.from(arrayLike, mapFn)

@Connormiha Can you check with a simple test on https://jsbench.me

@Connormiha
Copy link
Contributor Author

@jrieken
Copy link
Member

jrieken commented Oct 2, 2023

Thanks! I see Chrome more or less the same, Safari ~30% faster (using flatMap), and FF ~10% slower. Always a surprise but I'd say we take it

@jrieken jrieken enabled auto-merge October 2, 2023 17:40
@vscodenpa vscodenpa added this to the October 2023 milestone Oct 2, 2023
@jrieken jrieken merged commit e1d5cf5 into microsoft:main Oct 2, 2023
Alex0007 pushed a commit to Alex0007/vscode that referenced this pull request Oct 26, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Nov 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

6 participants