Hacker News Comments on
How Slow is JavaScript Really? JavaScript vs C++ (Data Structures & Optimization)
SimonDev
·
Youtube
·
6
HN points
·
0
HN comments
HN Theater has aggregated all Hacker News stories and comments that mention SimonDev's video "How Slow is JavaScript Really? JavaScript vs C++ (Data Structures & Optimization)".
Youtube Summary
HN Theater Rankings
- This course is unranked · view top recommended courses
Hacker News Stories and Comments
All the comments and stories posted to Hacker News that reference this video.
⬐
⬐ dheeraI felt really stupid when I wrote this yesterday, which you would NEVER do in C++:Like really? We want the processor to test for equality 9 times for "f", "u", "l", "f", "i", "l", "l", "e", "d"? Or is there some built-in optimization for this?Promise.allSettled(promises, (results) => { for(i in results) { if(results[i].status === "fulfilled") { .... } } }
Or should I do this, which feels hacky, but reduces it to 1 equality test?
const FULFILLED === "f"; Promise.allSettled(promises, (results) => { for(i in results) { if(results[i].status[0] === FULFILLED) { .... } } }
⬐ londons_exploreNow do the same again, but instead of just implementing your algorithm directly, use a few hundred npm packages to achieve the same. Don't forget to convert to/from base64 a bunch, and obviously make sure the famous leftPad is involved every step of the way.For fairness you can use a heavy sprinkling of inappropriate boost in the C++ side.
Now how do things compare?