4 ms·
Why is this noteworthy? That C++ is faster than pure Python is well known.
by Bostonian 6y ago
Why is this noteworthy? That C++ is faster than pure Python is well known.
- estebarb 6y agoMaybe a lot of people is developing in Python, Ruby, PHP and others traditionally interpreted languages and aren't aware of it. Using C or C++ for some domains would be painful, but regarding speed, memory usage or energy usage those languages tend to be the best. If only Rust would be less C++ like (I prefer "RISC" like languages)
- nicoburns 6y agoTrue, although Python and Ruby are extreme cases here. PHP is JIT'd these days, and can be quite a bit faster on this kind of numerical code. JavaScript even more so. I've seen posts on r/rust asking why their Rust port wasn't faster than the JS version, and it turned out not to be lack of optimisation, it was just simple numerical code (doesn't require allocation) which is already super-optimised by modern JS engines.
- igouy 6y agoMJIT https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/ https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-rele... (Also pypy)
- Rochus 6y agoThe performance gain of the MRI Ruby JIT is not really impressive, see e.g. http://software.rochus-keller.info/are-we-fast-yet_crystal_ruby_2_3_lua_node_i386_results_2020-12-23.pdf http://software.rochus-keller.info/are-we-fast-yet_crystal_r.... Actually also the factor 4 PyPy speed-up in geomean is not that much overall (e.g. compared to V8).
- igouy 6y agoBut it's existence is sufficient to add Ruby to the "is JIT'd these days" list.
- arithma 6y agoC++ expression-power has increased considerably since C++11, and I believe, semantically, Prime Number generation in both C++ and Python could be python-line for c++-(line[s]) translated. C++ approaching the comfort and ease of use of Python is a worthy goal to reach. The flip side is well appreciated too (Cython, where Python can converge to C++ performance is noteworthy as well).
- hawski 6y agoMaybe, because it's only a one order of magnitude faster? I would expect for it to be something between 10x and 100x faster.