[导入]JavaScript实现版本性能对比

 


Description

测试结果(单位:ms

Jscript

JavaScript-C

Dscript 1.02

DMDScript 1.05

fempty

空函数

500

47

31

15

fdecl

函数内声明一个变量

500

47

31

16

fassign

函数内进行一次赋值

547

63

500

953

fconcat

函数内进行一次字符串连接

5141

125

25406

18407

fpush

函数内进行一次数组的追加

3156

390

2313

4125

fadd

函数内进行一次自增

641

78

2218

2172

fnew

函数内进行一次高级对象的构造

5562

188

3672

2750

ffor

函数内进行for循环(100次)

2609

1797

3828

3625

fwhile

函数内进行while循环(100次)

2563

1781

3359

3641

Fforiter1

函数内使用for进行数组的遍历,直接用数组长度判断

3109

1047

4000

3765

Fforiter2

函数内使用for进行数组遍历,先将数组长度提取出来给e,用来进行判断

2203

844

4172

3496

fwhileiter1

函数内使用while进行数组的遍历,直接用数组长度判断

594

78

2641

2406

fwhileiter2

函数内使用while进行数组的遍历,先将数组长度提取出来给e用来进行判断

594

94

2953

2547

fforiniter

函数内使用for(in)来对数组进行遍历

91984

3281

3766

5922

Sieve.js

Eratosthenes Sieve prime number calculation10 iterations1899 primes

593

266

203

157

e.js

求自然对数e的小数点后500

2032

891

1110

1125


 

Microsoft Jscript 5.6

JavaScript-C Visual Studio.net 2003 编译,打开了为Pentium4sse2优化,优化等级/O2

Dscript 1.022003年的版本)以Digital Mars C/C++ 8.32.3 编译


文章来源:http://herald.seu.edu.cn/blog/shiningray/articles/18351.aspx

posted on 2005-05-11 23:05  ShiningRay  阅读(764)  评论(0编辑  收藏  举报