6 ms·
Ask HN: How to compare different programming languages
C++ is best for performance, in this case how to compare c++ to other languages in term of performance.
- MichaelCrawford 11y agoAssembly code is best for performance but it is a huge pita.
- indoindo 11y agoOf course, but how to determine languages that near ASM performance
- MichaelCrawford 11y agoC, c++ and ask permit allocation on the stack. Many others require dynamic allocation. Whether one language is faster depends on whether the problem at hand can take advantage of stack allocation.
- MichaelCrawford 11y agoMost modern computers have caches. On the whole they speed you up but some access patterns lead caches to slow you down. Some instruction set architectures have more registers than others. So the fastest language also has to consider the hardware it is used on.
- indoindo 11y agoThank you very much! insightful comments!
- MichaelCrawford 11y agoSome people just aren't very good coders. No language will make their programs run faster. What will are books like effective c++, effective java and refactoring. The fastest language only makes sense when the code is written by an expert.