JavaやるとC++は有害に感じる int 2
■ このスレッドは過去ログ倉庫に格納されています
0229デフォルトの名無しさん
2007/02/14(水) 02:09:17> つか、>>200 が勝手に
> >JavaはC++よりもメモリの管理速度やファイル操作が速いので
> とかぬかしてるだけな気がするんだが。
それにはソースがあるよ。
Comparison of Java and C++
http://en.wikipedia.org/wiki/Comparison_of_Java_and_C%2B%2B#Performance
* pointers make optimization difficult since they may point to arbitrary data or code
* newly allocated memory is close together because garbage collection compacts memory and allocations are thus sequential in memory; and hence more likely to be 'in the cache'
* run-time compilation can do a better job because it knows what processor it is running on and what code is running - the hot spots
One comprehensive study of microbenchmarks shows quite a large variation in results
but indicates that, in general, Java outperforms C++ in operations such as memory
allocation and file I/O while C++ outperforms Java in arithmetic and trigonometric operations.[3]
For numerical processing, Java has shown significant gains with each new version but
still lags C++ and Fortran, in part due to the requirement for reproducibility of floating-point
results across all platforms.[4]
[3]のソース
# ^ "Microbenchmarking C++, C# and Java" by Thomas Bruckschlegel, Dr. Dobbs, June 17, 2005
http://www.ddj.com/184401976
[4]のソース
# ^ "Java and Numerical Computing" by Ronald F. Boisvert, Jose Moreira, Michael Philippsen and Roldan Pozo, NIST, Dec 2000
http://www.javagrande.org/leapforward/cacm-ron.pdf
■ このスレッドは過去ログ倉庫に格納されています