3 ms·
Swift is faster than C++
- nfd 10y agoSort of. I bet I could take a snippet of C++ and find flags which would slow runtime right the heck down myself.
- ajarmst 10y agoNot that we needed it, but more evidence that the adjectives "faster" and "slower" are overloaded to the point of meaninglessness when discussing compilers and languages.
- ankurdhama 10y agoYeyyy.. hurrayyy ... ok back to work.
- lukaslalinsky 10y agoIf you are naive about data access, like in this case of inserting into an array without preallocation, C++ STL collections are pretty slow. I once wrote an algorithm that made heavy use of dictionaries in C++ and Python and the Python version was significantly faster. C++ just does not have fast general purpose collections in the standard library.