Programming Languages Comparision

The latest computer language benchmarks from
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all

[Note: Java 6.04,  SML-Mlton, Ocaml, D 已经有了不错的性能上的提升了。]

Gentoo : Intel® Pentium® 4


Computer Language Benchmarks Game 

 Create your own Ranking

What fun! Can you manipulate the multipliers and weights to make your favourite language the best programming language in the Benchmarks Game?


  x  languagemean-
1.0C++ GNU g++1.202
1.1GNU gcc1.352
1.2Digital Mars1.412
1.2Clean1.483
1.3Pascal Free Pascal1.522
1.5Oberon-2 OO2C1.757
1.5Haskell GHC1.781
1.6Eiffel SmartEiffel1.893
1.7SML MLton2.064
1.8OCaml2.113
1.8Lisp SBCL2.113
1.8BASIC FreeBASIC2.172
1.8Java 6 -server2.191
2.0Ada 2005 GNAT2.372
2.0Scala2.461
2.4C# Mono2.882
2.4CAL2.941
2.7Nice3.241
3.0Forth bigForth3.663
3.2Fortran G953.876
5.7Erlang HiPE6.851
9.0Smalltalk VisualWorks10.861
9.3Scheme MzScheme11.207
12Lua14.903
14Mozart/Oz17.112
17Pike20.824
18Python21.071
20Perl24.153
23PHP27.123
47Tcl56.243
49JavaScript SpiderMonkey59.336
54Ruby65.412
65Prolog SWI77.699
multipliers
Full CPU Time
Memory Use
GZip Bytes
benchmarkweight
binary-trees

chameneos-redux (new)

fannkuch

fasta

k-nucleotide

mandelbrot

meteor-contest

n-body

nsieve

nsieve-bits

partial-sums

pidigits

recursive

regex-dna

reverse-complement

spectral-norm

startup

sum-file

thread-ring (new)

 about the Ranking

(Language implementations with more than a couple of Timeouts distort the ranking - so they have been excluded. They can still be compared directly against another language implementation.)

For each benchmark, the best measurement B is the lowest non-zero measurement. For each language implementation, the measurement L for the language implementation is converted to the ratio L/B

The ratio can be adjusted by a measurement multiplier (make CPU time or memory use or lines-of-code more or less important) and by a benchmark weight (make particular benchmarks more or less important).

For each language implementation, we report the Weighted Geometric Mean of those L/B ratios.

Java VS C# mono:

Compare the performance of Java 6 -server programs against some other language implementation, or check the Java CPU time and Memory use measurements.

For more information about the Java implementation we measured see ↓ about Java 6 -server.

Compare to:

 Are the Java 6 -server programs better?

For each of one our benchmarks, a white bar shows which language implementation had the faster program, and a black bar shows which used the least memory.

 How many times better?

How many times faster or smaller are the Java 6 -server programs than the corresponding C# Mono programs?

Java 6 -server x times better
~ C# Mono x times better
Program & Logs Faster Smaller: Memory UseSmaller: GZip BytesReduced N
binary-trees1.2~1.61.0
chameneos-redux (new)No program


fannkuch1.6~1.9~1.4
fasta1.2~2.2~1.1
k-nucleotide1.11.1~1.0
mandelbrot2.2~2.2~1.3
meteor-contest  No Mono
n-body1.8~2.2~1.0
nsieve~1.0~1.5~1.3
nsieve-bits1.1~1.7~1.4
partial-sums~1.6~2.4~1.0
pidigits~1.1~2.01.1
recursive1.1~2.21.0
regex-dna2.42.4~1.1
reverse-complement~1.2~2.0~1.2
spectral-norm1.9~2.6~1.1
startup~2.0 1.1
sum-file2.3~2.3~1.1
thread-ring (new)1.3~2.1~1.1

 about Java 6 -server

java version "1.6.0_04"
Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
Java HotSpot(TM) Server VM (build 10.0-b19, mixed mode)



While the provided references do not directly address the comparison of different types of pointers in programming, in general programming, different types of pointers can be compared in various ways. ### Pointer Comparison Rules - **Same Type Comparison**: When comparing pointers of the same type, the comparison is often based on the memory addresses they point to. For example, in C and C++, if you have two pointers of the same type, you can use comparison operators such as `==`, `!=`, `<`, `>`, `<=`, and `>=`. If two pointers point to the same memory location, the `==` comparison will return `true`. ```c #include <stdio.h> int main() { int a = 10; int b = 20; int *ptr1 = &a; int *ptr2 = &a; int *ptr3 = &b; if (ptr1 == ptr2) { printf("ptr1 and ptr2 point to the same location.\n"); } if (ptr1 != ptr3) { printf("ptr1 and ptr3 point to different locations.\n"); } return 0; } ``` - **Different Type Comparison**: Comparing pointers of different types is more complex and often implementation - defined. In some languages, direct comparison of pointers of different types is not allowed. In C and C++, you can cast pointers to a common type (usually `void *`) before comparison. However, the result of such a comparison may not always be meaningful, especially if the pointers point to different types of objects. ```c #include <stdio.h> int main() { int a = 10; char c = 'A'; int *intPtr = &a; char *charPtr = &c; void *voidPtr1 = (void *)intPtr; void *voidPtr2 = (void *)charPtr; if (voidPtr1 != voidPtr2) { printf("The pointers point to different locations.\n"); } return 0; } ``` ### Special Cases - **Null Pointer Comparison**: A null pointer can be compared with other pointers. In most languages, a null pointer represents a pointer that does not point to a valid memory location. Comparing a pointer with a null pointer is a common way to check if a pointer is valid. ```c #include <stdio.h> int main() { int *ptr = NULL; if (ptr == NULL) { printf("The pointer is null.\n"); } return 0; } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值