Performance Comparison between C ++, C # and Java

Source: Internet
Author: User

Original article http://www.tommti-systems.de/go.html? Http://www.tommti-systems.de/main-Dateien/reviews/languages/benchmarks.html

 

A very old articleArticleHowever, the results are enlightening and indicate the differences in the performance of several languages. However, the test versions are old, so only the previous section is excerpted.

 

Test Environment

AMD athlon XP 2200 +
1024 mb ddr 266
Via kt266a
Windows XP prof. + SP1

 

Java version
Java 1.4.2 _ 03
Java 1.5 (alpha, 11. Dec. 03)
Compilation option:-G: None
Running parameters:-mx1024m

 

C # version
. NET Framework 1.1.4322 (Microsoft (r) Visual C #. Net compiler version 7.10.3052.4)
Compilation options:/optimize +/debug-/checked-
Running parameters:

 

C ++ version
Microsoft Visual Studio NET 2003 (Microsoft (r) 32-bit C/C ++ Optimizing Compiler version 13.10.3077 for 80x86)
Compilation options:/O2/OI/OG/OT/ehs/ arch: SSE
Intel (r) C ++ compiler for 32-bit applications, version 8.0 build 20031017z
Compilation options:/fast/g6/OI/OG/OT/ehs/ arch: SSE
Running parameters:

 

Source code

Original SourceCode

Http://www.cowell-shah.com/research/benchmark/code

Http://dada.perl.it/shootout/

Http://www.bagley.org /~ Doug/shootout

Modified source code

Java
C #
C ++

 

Test Results
Maximum memory usage:
Java-163 MB
C #-111 MB
CPP-98 MB

 

Time unit: milliseconds

C ++ is the fastest, but STL hashmaps is much slower. Memory footprint
C # very fast, but there are some problems in handling exceptions, matrix multiplication and loop nesting.
Java's hashmaps are the fastest, and exception handling is very powerful.
C ++ is the fastest, but Java and C # are much faster in development than C ++.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.