Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

if you're just trying to initialize a new Array, you can just hardcode it and get much better performance. https://www.measurethat.net/Benchmarks/Show/29982/0/hardcode...

This isn't necesarrily unknown, but knowing that there's a cost associated with promises and async/await will get you pretty far in terms of performance. I remember the idea first clicking when I watched this : https://www.youtube.com/watch?v=SMBvjmeOotA



It's an interesting trick with the hardcoded array! Thanks.

The video you posted is a bit chaotic, so I don't really want to watch 1.5 hours just to get something that could be summarized in one line. But anyway... I understand the downsides of promises calls, but there are also advantages, such as not blocking page rendering, which I heavily rely on.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: