[转帖]主流语言的性能

软件和网站开发以及相关技术探讨
回复
头像
kofshower
帖子: 1343
注册时间: 2007-03-13 11:23
送出感谢: 0
接收感谢: 0
联系:

[转帖]主流语言的性能

#1

帖子 kofshower » 2008-07-22 8:01

代码: 全选

Benchmarking programming languages?

How can we benchmark a programming language?
We can't - we benchmark programming language implementations.

How can we benchmark language implementations?
We can't - we measure particular programs.

21 Jul 2008

Benchmarks timed on:
 Gentoo : Intel® Pentium® 4 
	

26 Feb 2008

Benchmarks timed on:
 Debian : AMD™ Sempron™ 

Programming language measurements A to Z

Ada 2005 GNAT large-scale safety-critical software

BASIC FreeBASIC quickbasic compatible imperative programming

C CINT seamless c c++ interpreter compiler

C Cyclone safe dialect of c Debian

C GNU gcc unchecked low-level programming

C Intel unchecked low-level programming

C Tiny unchecked low-level programming Debian

C# Mono oo plus functional style (mono is not ms .net)

C++ GNU g++ c plus objects plus generics

C++ Intel c plus objects plus generics

CAL lazy functional programming for jvm

Clean lazy & strict pure functional programming

D Digital Mars c++ reduced and simplified

D GNU c++ reduced and simplified Debian

Dylan Gwydion multi-method oo programming Debian

Eiffel SmartEiffel everything is an object plus design by contract

Erlang concurrent real-time distributed fault-tolerant software

Erlang HiPE jit native code compiler for erlang

F# Mono higher-order type-safe programming (mono is not ms .net)

Forth bigForth extensible postfix stack programming

Forth GNU GForth extensible postfix stack programming

Fortran G95 pioneering numeric and scientific programming

Fortran Intel pioneering numeric and scientific programming

Groovy “agile” “dynamic” “java compatible” for jvm

Haskell GHC lazy pure functional programming

Icon high-level string processing

Io everything is a prototype object minimalism

Java 1.4 -server ubiquitous jit server virtual machine

Java 6 -client ubiquitous jit client virtual machine

Java 6 -server ubiquitous jit server virtual machine

Java 6 -Xint ubiquitous bytecode interpreter virtual machine

Java 6 -Xms64m initial java server heap size 64m

Java GNU gcj optimizing ahead-of-time compiler

JavaScript JavaScriptCore WebKit-based ECMA scripting implementation Debian

JavaScript Rhino web-browser to jvm scripting

JavaScript SpiderMonkey ubiquitous web-browser embedded scripting

Lisaac everything is a prototype object plus design by contract

Lisp SBCL pioneering s-expression oriented programming

Lua associative arrays for extensible embedded scripting

Lua LuaJIT jit compiler fully compatible with lua 5.1

Matlab GNU Octave linear and nonlinear problems and numerical experiments Debian

Mercury functional & logic programming

Mozart/Oz multi-multi-multi-paradigm distributed programming

Nice multi-method type-safe oo for jvm

Oberon-2 OO2C modular programming plus objects

Objective-C GNU c plus a thin layer of smalltalk Debian

OCaml modular type-safe strict functional programming plus objects

OCaml (bytecode) modular type-safe strict functional programming plus objects Debian

Parrot PIR intermediate code for parrot byte code or parrot asm Debian

Pascal Free Pascal imperative programming plus objects

Perl server-side shell & cgi scripts

PHP scripts embedded in html, and much more

Pike explicitly-typed dynamic oo programming

Prolog SWI goal-oriented pattern-matching rules and facts

Prolog YAP goal-oriented pattern-matching rules and facts

Python uncluttered imperative programming plus objects

Python IronPython scripting for .net (mono is not ms .net)

Python Psyco representation-based just-in-time specialization

Rebol metadata scripting for distributed computing

Rexx Regina historic - originally ibm - scripting Debian

Ruby programmer fun - everything is an object scripting

Ruby Core 1.9.0 yet another ruby virtual machine

Ruby JRuby everything is an object scripting for jvm

S-Lang embeddable extension language Debian

Scala higher-order type-safe programming for jvm

Scheme Bigloo statically-scoped properly tail-recursive dialect of lisp Debian

Scheme Chicken translate scheme source to portable c code

Scheme Ikarus R6RS compatible incremental compiler


Scheme PLT statically-scoped properly tail-recursive dialect of lisp

Smalltalk GNU uniform reflective environment - for scripting

Smalltalk Squeak uniform reflective environment - real live objects

Smalltalk VisualWorks uniform reflective environment - real live objects

SML MLton whole-program optimizing compiler

SML SML/NJ modular type-safe strict functional programming

Tcl everything is a string - programmable programming

Zonnon Mono active objects (mono is not ms .net) 
为此DHH的评论是
Outsourcing the performance-intensive functions
测试结果:
http://shootout.alioth.debian.org/
上次由 kofshower 在 2008-07-22 12:16,总共编辑 1 次。
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
JiangHui
论坛版主
帖子: 21301
注册时间: 2007-08-02 20:29
系统: 窓辺とうこ
送出感谢: 0
接收感谢: 13 次

#2

帖子 JiangHui » 2008-07-22 9:10

强烈要求翻译
poet
帖子: 2841
注册时间: 2006-09-11 22:47
送出感谢: 0
接收感谢: 4 次

#3

帖子 poet » 2008-07-22 9:28

性能评测结果呢???

贴这么多语言,没有平册结果有什么用。
Athlon64
帖子: 72
注册时间: 2006-04-13 13:43
送出感谢: 0
接收感谢: 1 次

#4

帖子 Athlon64 » 2008-07-22 10:59

poet 写了:性能评测结果呢???

贴这么多语言,没有平册结果有什么用。
头像
kofshower
帖子: 1343
注册时间: 2007-03-13 11:23
送出感谢: 0
接收感谢: 0
联系:

#5

帖子 kofshower » 2008-07-22 12:18

JiangHui 写了:强烈要求翻译
上面都是这个评测的平台和涉及的语言。。
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
头像
kofshower
帖子: 1343
注册时间: 2007-03-13 11:23
送出感谢: 0
接收感谢: 0
联系:

#6

帖子 kofshower » 2008-07-22 12:21

poet 写了:性能评测结果呢???

贴这么多语言,没有平册结果有什么用。
结果很复杂啊,一个语言一页。参见下面的链接咯
基本上速度都是脚本语言的弱点。所以DHH(Rail的发明人)才会说“把性能密集的程序外包出去”
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
头像
kofshower
帖子: 1343
注册时间: 2007-03-13 11:23
送出感谢: 0
接收感谢: 0
联系:

#7

帖子 kofshower » 2008-07-22 12:29

里面给出了测试算法的代码
编译指令
和对照类似语言的性能
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
poet
帖子: 2841
注册时间: 2006-09-11 22:47
送出感谢: 0
接收感谢: 4 次

#8

帖子 poet » 2008-07-22 12:48

看来同时测试性能和内存占用很重要!

Java JIT 跟 C 的性能差距已经缩小到十倍以内,然而其内存占用却是C的十倍到一百倍的水平。

相反,Python的跟C的性能差距仍然在十到一百倍之间,其内存占用却在C的十倍以内。
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
送出感谢: 0
接收感谢: 7 次
联系:

#9

帖子 BigSnake.NET » 2008-07-22 12:58

期待 pypy ..
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
头像
kofshower
帖子: 1343
注册时间: 2007-03-13 11:23
送出感谢: 0
接收感谢: 0
联系:

#10

帖子 kofshower » 2008-07-22 13:04

poet 写了:看来同时测试性能和内存占用很重要!

Java JIT 跟 C 的性能差距已经缩小到十倍以内,然而其内存占用却是C的十倍到一百倍的水平。

相反,Python的跟C的性能差距仍然在十到一百倍之间,其内存占用却在C的十倍以内。
Java预编译而且加载到内存中了。所以有这样的成绩。
咔咔。如果不开git的话~~
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
回复

回到 “软件/网站开发”