Discussion

Ask HN: Why is Array.from so slow?

I made this benchmark here: https://jsperf.com/ways-to-get-a-random-string

And I lack the formal knowledge to understand why the Array.from version is about 25% as fast as the while loop version, being that they intuitively should do something similar.

Can you please help me understand?

5 points cfv 7 years ago 2 comments

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton