Hacker News new | ask | show | jobs
by rubber_duck 3313 days ago
Actually 3rd party libraries and application code is where .NET is likely to be faster unless node lib is wrapping a C library - .NET can easily beat JS an order of magnitude simply by having control of memory layouts and high performance/specialized data structures. Meanwhile JS has crap structures (doesn't even have primitive arrays) and everything is it's dynamic object where you pray the JIT eventually figures out a constant structure and tries to optimize.
2 comments

Just to nitpick a bit, JS does have primitive arrays using TypedArray.
This is a good point - it's also why you can still optimize JS on microbenchmarks but for real world code where you'd want to use an array of structs in say C# for eg. there's just no JS equivalent other than write obfuscated stuff around typed arrays.
Yes, but if your going to compare(Badly in this case). You probably want to test it in isolation.