主题:【倡议】Java SE 5.0和.NET 2.0擂台赛 -- Highway
这是我从网上找来的,本来应该以文摘的方式转载,但是西西河的文章标题长度限制使得它成为不可能,我只好把它附在内容里了。
.NET 2.0 and Java 1.5 for numerical computing
Going ahead with my numerical algorithms translation, I started to wonder if I was going to win something in performance. Is .NET 2.0 going to be faster than Java 1.5 for numerical computing? To find out, I downloaded the SciMark2 benchmark from the http://math.nist.gov site and I translated it to C# using Visual C# Express, at this point I didn't try to understand (let alone enhance) the code, only to get it working in C# (except a couple of obvious changes like using Array.CopyTo() to copy arrays). Anyway, these are the results I got with Java 1.5 Beta 2 in my portable (2.8 GHz Mobile Intel Pentium 4 CPU):
FFT (1024): 112.99822846954115
SOR (100x100): 378.42792716276983
Monte Carlo : 47.71337303709922
Sparse matmult (N=1000, nz=5000): 144.6072353535397
LU (100x100): 355.1855612455282
And these are the results I got with .NET 2.0 Beta 1:
Composite Score: 320.261977294581
FFT (1024): 225.063751509717
SOR (100x100): 395.271584950618
Monte Carlo : 18.592932017316
Sparse matmult (N=1000, nz=5000): 484.889267269725
LU (100x100): 477.492350725527
The results are in Mflops so Whidbey seems to be roughly 50% better than Tiger. Of course, these results are very preliminary and they will vary from machine to machine, so you can download the C# SciMark2 from http://www.logicstudio.net/Net2005/SciMark2.zip (the translation is awful right now and barely use C# idioms but, hey, it runs!) Give it a try and let me know how it goes.
Doing benchmarks is always dangerous, and doing it with betas even more so, so I run the benchmarks with Java 1.4.2_05 and got this:
Composite Score: 212.73680429939608
FFT (1024): 107.32467730480086
SOR (100x100): 376.06459421216255
Monte Carlo : 46.94569063386169
Sparse matmult (N=1000, nz=5000): 146.67860553090557
LU (100x100): 386.6704538152499
And with .NET 1.1.4322:
Composite Score: 336,152586167483
FFT (1024): 236,507205423729
SOR (100x100): 405,674738526316
Monte Carlo : 25,873449174941
Sparse matmult (N=1000, nz=5000): 476,624132235073
LU (100x100): 536,083405477354
For both platforms the production versions are better than the betas but note I run the tests in the same machine but with *different* Windows XP installations so don't jump into conclusions. In any case the difference between Java and .NET seems to be consistent.
- 相关回复 上下关系8
响应老轧同志的伟大号召,积极投身于擂台赛这场伟大的革命运动之中去 老兵帅客 字276 2004-10-01 15:47:19
😉Java SE 5.0和.NET 2.0 性能初试 (草案) Highway 字1764 2004-09-30 17:14:50
😅测试修正(使用Java Server VM)重新测试 Highway 字533 2004-10-01 08:12:41
一个二者性能比较的例子
Thanks. Very useful information! Highway 字0 2004-09-30 19:08:29
😜到底什么是.net 呀 ppw 字48 2004-09-30 17:18:34
😉大差不差。微软不叫虚拟机,叫CLR Highway 字155 2004-09-30 17:23:26
那~~~Java方面老兄用的是啥虚拟机阿? 你克我服 字235 2004-10-01 02:06:30