Like Tree4Likes

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

This is a discussion on Java speeds have caught up to C/C++ and sometimes passes them within the Tech Board forums, part of the Community Boards category; I think what's possibly more relevant WRT to the difference between comparable applications done in C, C++, and Java is ...

  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.

Page 2 of 2 FirstFirst 12
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, 03: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, 04:42 PM
  5. Replies: 14
    Last Post: 08-19-2004, 11:10 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21