2017年的golang、python、php、c++、c、java、Nodejs性能對比[續]


 2017年的golang、python、php、c++、c、java、Nodejs性能對比[續]

  最近忙,這個話題放了幾天,今天來個續集。   上篇傳送門: 2017年的golang、python、php、c++、c、java、Nodejs性能對比(golang python php c++ java Nodejs Performance)

 

    好了,上回的某些事有些人有異議,今天也回應下。

  1.有人說python性能沒那么Low?

  這個我用pypy 2.7確認了下,確實沒那么差, 如果用numpy或其他版本python的話,性能更快。但pypy還不完善,pypy3在beta,  所以一般情況,我是說一般情況下,這點比較讓人不爽。

qiangjian@sun-pro:/works/learnCPP$ pypy -V && time pypy fib.py
Python 2.7.12 (aff251e54385, Nov 09 2016, 17:25:49)
[PyPy 5.6.0 with GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)]
5702887

real    0m0.206s
user    0m0.173s
sys     0m0.028s

  2.有人說怎么沒有C#、Rust、Ruby這個那個的?

  我只想說語言百千萬,實在太多,但精力不要放在工具上, 選擇一個合適的就好。 

  實在想看,也有:

 

 

Language CPU time Slower than Language
version
Source
code
User System Total C++ previous
C++ (optimized with -O2) 0.899 0.053 0.951 g++ 6.1.1 link
Rust 0.898 0.129 1.026 7% 7% 1.12.0 link
Java 8 (non-std lib) 1.090 0.006 1.096 15% 6% 1.8.0_102 link
Python 2.7 + PyPy 1.376 0.120 1.496 57% 36% PyPy 5.4.1 link
C# .NET Core Linux 1.583 0.112 1.695 78% 13% 1.0.0-preview2 link
Javascript (nodejs) 1.371 0.466 1.837 93% 8% 4.3.1 link
Go 2.622 0.083 2.705 184% 47% 1.7.1 link
C++ (not optimized) 2.921 0.054 2.975 212% 9% g++ 6.1.1 link
PHP 7.0 6.447 0.178 6.624 596% 122% 7.0.11 link
Java 8 (see notes) 12.064 0.080 12.144 1176% 83% 1.8.0_102 link
Ruby 12.742 0.230 12.972 1263% 6% 2.3.1 link
Python 3.5 17.950 0.126 18.077 1800% 39% 3.5.2 link
Perl 25.054 0.014 25.068 2535% 38% 5.24.1 link
Python 2.7 25.219 0.114 25.333 2562% 1% 2.7.12 link


       還有權威對比: https://benchmarksgame.alioth.debian.org/u64q/go.html   原文 https://blog.famzah.net/2016/09/10/cpp-vs-python-vs-php-vs-java-vs-others-performance-benchmark-2016-q3/

   大家看看就好。

  

  最后,就是加個大圖,說明一切

 

  但是圖中沒有算compile時間,對動態語言不公平。

  另外, 性能相差不大的話, 誰開發效率高,誰是王者, 明顯Go是未來明星(也許要加之一,哈哈),nodejs潛力不小!!!

 

 

 

     

  

  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM