Thread: Java speeds have caught up to C/C++ and sometimes passes them

  1. #16
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    I think what's possibly more relevant WRT to the difference between comparable applications done in C, C++, and Java is the amount of memory consumed. The benchmark game sort of hides from this because the tasks are simple one-off things, but with large and complex programs you'll almost certainly notice the one done in C uses substantially less memory than the one done in C++ or Java, if the C++ or Java programmer is really taking advantage of all the features of the language. Of course, the code base for the C version will probably be bigger too (due to the lack of features ).
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  2. #17
    Registered User
    Join Date
    Sep 2011
    Posts
    1
    Quote Originally Posted by MK27 View Post
    The benchmark game sort of hides from this because the tasks are simple one-off things, but with large and complex programs you'll almost certainly notice the one done in C uses substantially less memory than the one done in C++ or Java, if the C++ or Java programmer is really taking advantage of all the features of the language. Of course, the code base for the C version will probably be bigger too (due to the lack of features ).
    With respect to Java, the benchmarks game exaggerates Java memory use "because the tasks are simple one-off things" and unlike those tasks "with large and complex programs you'll almost certainly" need to allocate more memory than the JVM default ;-)

    So instead of the n-body task where the Java program is listed as using 47x more memory than the C program, for memory usage we should look at k-nucleotide, reverse-complement, binary-trees and regex-dna - Java programs using 2-3x more memory than the corresponding C programs.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Collision not working at higher speeds
    By Shamino in forum Game Programming
    Replies: 2
    Last Post: 12-15-2009, 12:37 PM
  2. Binary File Manipulation Speeds
    By Shonumi in forum C++ Programming
    Replies: 5
    Last Post: 04-20-2009, 02:07 AM
  3. upload / download speeds
    By Dino in forum Tech Board
    Replies: 20
    Last Post: 11-25-2008, 09:06 PM
  4. Unbelievable wind speeds
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 09-09-2004, 03:42 PM
  5. Replies: 14
    Last Post: 08-19-2004, 10:10 AM

Tags for this Thread