zoukankan      html  css  js  c++  java
  • 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这个那个的?

      我只想说语言百千万,实在太多,但精力不要放在工具上, 选择一个合适的就好。 

      实在想看,也有:

     

    LanguageCPU timeSlower thanLanguage
    version
    Source
    code
    UserSystemTotalC++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潜力不小!!!

         

      

      

  • 相关阅读:
    设计模式-观察者模式
    idea 生成 protobuf
    springboot @Autowride 注入空 调用时报Null空指针
    Netty 服务端创建过程
    git failed to push some refs to
    SPI simp
    Controller之statefulset
    Service
    Controller之deployment
    rabbitmq“ Login was refused using authentication mechanism PLAIN”
  • 原文地址:https://www.cnblogs.com/sunsky303/p/6605148.html
Copyright © 2011-2022 走看看