主题:【倡议】Java SE 5.0和.NET 2.0擂台赛 -- Highway
如果把你程序中的a.Add(aObj)换成a.Add(aObj).toString(),我们将得到另外一组数据:
Java without toString()
Serialization and Deserialization of 50*1000 items take:2344 ms.
Serialization and Deserialization of 500*100 items take:438 ms.
Serialization and Deserialization of 5000*10 items take:359 ms.
Serialization and Deserialization of 50000*1 items take:641 ms.
Serialization and Deserialization of 50000*10 items take:11016 ms.
Java with toString()
Serialization and Deserialization of 50*1000 items take:1406 ms.
Serialization and Deserialization of 500*100 items take:297 ms.
Serialization and Deserialization of 5000*10 items take:329 ms.
Serialization and Deserialization of 50000*1 items take:437 ms.
Serialization and Deserialization of 50000*10 items take:35078 ms.
.Net with toString();
Serialization and Deserialization of 50*1000 items take:297 ms.
Serialization and Deserialization of 500*100 items take:234 ms.
Serialization and Deserialization of 5000*10 items take:313 ms.
Serialization and Deserialization of 50000*1 items take:312 ms.
Serialization and Deserialization of 50000*10 items take:4000 ms.
我们可以看出,当不使用toString()的时候,明显是Java占上风,但是当使用toString()的时候,.Net则明显占了上风。看来.Net的问题应该是出在了深层目标的Serialization和Deserialization上面,而不是ArrayList层面。
- 相关回复 上下关系8
用不同的参数,运行多次,其结果比较参差。 Highway 字1401 2004-10-05 12:28:40
后天我才有时间对你的这个和下面那个问题进行测试 老兵帅客 字58 2004-10-04 15:19:10
😅串行化/反串行化小测试中Java取得绝对性胜利! Highway 字7765 2004-10-01 16:28:48
一件有趣的事情
有些技术,由于设计思想就不同,所以结果就会差别很大。比如 Highway 字289 2004-10-08 06:53:02
☹️这个我试验过了,用的是微软自己的例子,结果也一样 老兵帅客 字0 2004-10-05 12:06:07
我觉得你可以试着调整一下.Net的ArrayList的构造参数 老兵帅客 字246 2004-10-01 16:55:56
😉应该和这个没有关系.往ArrayList充填东西的时候时间是另算的! Highway 字208 2004-10-01 20:38:40