|
今天在2410上 弄了个phoneme,带JIT,跑了跑debian performance game里的binarytrees例子,java运行速度居然比c++还快!算上所有的加载虚机的时间还是快于c++,除掉加载时间的话,速度接近c++两倍!!!
测试代码从debian上下载的, http://shootout.alioth.debian.org/
真正大吃了一斤,不,一斤半!!!
java输出信息
$ time ./cvm -cp ../democlasses.jar cdc.binarytrees 12
stretch tree of depth 13 check: -1
8192 trees of depth 4 check: -8192
2048 trees of depth 6 check: -2048
512 trees of depth 8 check: -512
128 trees of depth 10 check: -128
32 trees of depth 12 check: -32
long lived tree of depth 12 check: -1
program running time 3542 ms
real 0m 3.80s
user 0m 3.37s
sys 0m 0.24s
c++输出信息
[]$ time ../../binarytree_cpp 12
stretch tree of depth 13 check: -1
8192 trees of depth 4 check: -8192
2048 trees of depth 6 check: -2048
512 trees of depth 8 check: -512
128 trees of depth 10 check: -128
32 trees of depth 12 check: -32
long lived tree of depth 12 check: -1
real 0m 6.27s
user 0m 6.06s
sys 0m 0.05s |
阿莫论坛20周年了!感谢大家的支持与爱护!!
曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……
|