Optimization for free

Discussion in 'Game Development (Technical)' started by princec, Jan 30, 2006.

Thread Status:
Not open for further replies.
  1. oNyx

    Original Member

    Joined:
    Jul 26, 2004
    Messages:
    1,212
    Likes Received:
    0
    "that the architecture of Java simply can't come to par to the one of C++ when it comes to speed"

    So, yes the date is important. There were massive improvements in the meantime.

    "that you cannot even read"

    I didnt read it at all. Its dated and thus half of the information is most likely wrong and/or provides bad practise.

    "How having less features, give the programmer less possibilities, could ever result in faster execution code?"

    Its easier for a compiler to optimize. See also this link (which I already posted before):
    http://www.idiom.com/~zilla/Computer/javaCbenchmark.html

    blabla

    "Why did you bring as argument the date 2000?"

    Thats 1.2 days. 1.3 was faster. 1.4 was faster. 1.5 was faster. And with 1.6 there is a surprisingly big performance jump.

    Oh and your insulting tone isnt very mature. Calm down. You don't want to look stupid, do you?
     
  2. Fabio

    Original Member

    Joined:
    Sep 30, 2005
    Messages:
    499
    Likes Received:
    0
    False, tell me if the many points (and couldn't add more because no post can be more than 10000 characters long on this board, I discovered) that I have listed and that you (but not other readers of this thread) have beautifully ignored have been improved in any way since 2000 till today. Or will ever, for the matter. They would break compatibility completely. But you probably don't even understand what we're talking about here, so..

    Again, you're totally deaf: those things are valid today and will be valid tomorrow. It's not that the OOP nature of Java will change anytime soon just to break the very nature of Java: a language for kids, that is designed to make sure that unexperienced programmers won't get in trouble. You will never see MI in Java. You will never bypass GC in Java. You will never get unions in Java. You will never get pointers in Java. You will never have the chance to get rid of the overhead of the "virtual" methods in Java. Why? Because fixing all of that would turn it into C++, and would break the reason of Java existance: make things easier for unexperienced programmers. That's the only reason why it's so widely used in schools, after all. And while compiler technology improves year after year (not only Java compiler technology, also C++ one), its improvements will never address these limitations that are intrisic in the language. Too easy to understand, I'm afraid..

    Bullshit. You don't know one single thing about compiler technology. If you don't use those features in C++ (something you are FREE to do, unlike in Java, where freedom is much more limited), a compiler could spot it anyway and optimize as well. So your point, for a change, is totally bogus.

    Big nonsense to which I've already answered in many ways, and also providing these two links which perfectly address all of this nonsense already:

    http://www.freewebs.com/godaves/javabench_revisited/

    and

    http://www.w3sys.com/pages.meta/benchmarks.html

    but you of course haven't read them because you're religiously tied to Java, and I'm afraid you also lack the abilities to understand the arguments that are addressed in those documents anyway. It's only your religion that drives you, and you say that those like me are doing it, instead. Nothing could be more false.. if it was only about choices, I would code in Asm and in my own language. Instead, because the real world has its own rules, I use C++ a lot, a language I personally think is far from being perfect, but at least gives some options to the experienced programmer (and exactly in this lies its biggest power). You instead are bond religiously to Java and nothing will open your eyes, never. You listen to any and all bogus arguments that are pro-Java and simply ignore objective evidence that proves without any doubt that reality is different than that Java hype. I have nothing to gain to prefer C++ to Java in my need to replace in big part Asm, if Java was really more powerful than C++ I'd not hesitate a single moment and would use it, instead of C++. But this doesn't happen because Java is only a subset of C++, a crippled C++, to suit beginner's needs, not experienced programmers ones. For that already exists C++, so why should they have created another language if not to address a different need? (D improves in some points C++, but has its own defects as well).
    Java is the toy, safe version of C++. Nothing wrong with that, as long as one understands it. Java is much better suited to beginners, but its limitations will soon be a trouble for more experienced programmers. I don't think that John Carmack or Linus Torvalds, just to name two, use C++ instead of Java because they're less intelligent than you or more bigot. Rather, the opposite, and without any doubt.
    Java has definitely its (big) place, but certainly not to outperform nor to replace C++ in advanced tasks.

    Congratulations, this is definitely the best argument you produced so far.

    FASTER WHAT? HOW COULD BE ENFORCED TO ALWAYS USE VIRTUAL FUNCTIONS, WITH THEIR OVERHEAD, BE BENEFICIAL VERSUS HAVING A CHOICE TO DO IT ONLY WHERE NECESSARY?? Why do you keep on making a fool of yourself I really don't understand. While Java compiler technology improves, it will never be able to address those limitations, because they're intrinsic in the language, and addressing them would turn Java into C++. Simple as that. But you seem to not understand such a simple thing.. what a pain.

    You already allocated all of that, so there's no risk anyway. Now wait that your Garbage Collector releases it (if ever), so I can take some.. you resource hog. ;)
     
  3. oNyx

    Original Member

    Joined:
    Jul 26, 2004
    Messages:
    1,212
    Likes Received:
    0
    No, they dont address that stuff at all.

    Dear AOL-user, jitted code can be faster, because the code can be optimised for this platform (like using SIMD if available). Additionaly it can optimize for those pathes which are actually used on this run.

    From that link:
    .NET still provides a traditional pre-compiler ngen.exe, but "since the run-time only optimizations cannot be provided... the code is usually not as good as that generated by a normal JIT."

    As soon as the gains outweight the loss, Java (or any other just in time compiled language) will be faster than C++ for any non trivial program. JIT is relatively new stuff and there is still some progress and room for further optimisations (as the big speed jump from 1.5 to 1.6 has shown). Whereas you wont see anything ground breaking on the C++ side ever again.

    Giving you a broad hint with java biased benchmarks didnt work as expected. I guess it was to subtle. Heh. But you know... there are also unbiased/fair benchmarks were java was about as fast as C++ in most cases (or faster - on Opteron systems). Its just like java is getting faster all the time and this trend will continue. And C++... well, it wont change much anymore. Those days are over.

    C/C++ will of course always have its place for years to come. For things like video codecs, drivers, small command line tools, operating systems... for all that stuff its a really good choice. Seriously. But it isnt the one-size-fits-all hammer you want it to be. For indie games with a small team and no big $$$ for awesome middleware, C/C++ isnt really the most economical choice. Spending 3-5 times more on programming isnt worth it if it only yields a few percent more sales (eg if it needs 50mhz less and also 16mb ram less... that hardly makes a difference).

    And I also didnt say that java is the perfect choice for this scope. Its just a pretty reasonable choice compared to C/C++ (especially for that pain free mac support). Blitz for example is pretty nice, but I really loathe that syntax.

    Oh and one insult more and I put you on ignore. I'm really getting tired of it.
     
  4. Fabio

    Original Member

    Joined:
    Sep 30, 2005
    Messages:
    499
    Likes Received:
    0
    Put me on ignore, please (and without insult).
     
  5. oNyx

    Original Member

    Joined:
    Jul 26, 2004
    Messages:
    1,212
    Likes Received:
    0
    You mean additional insults. You insulted me 14 times already.

    If you haven't noticed that... pay more attention next time.
     
  6. Fabio

    Original Member

    Joined:
    Sep 30, 2005
    Messages:
    499
    Likes Received:
    0
    You insulted my intelligence and patience many more times.

    You just entered into my killfile anyway, so do whatever you want. Who cares?
     
  7. princec

    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    4,873
    Likes Received:
    0
    Silly argument. Fabio, you need to do some research. There are a few white papers about on the subject of JIT optimisations (such as, for example, the reason why virtual methods can be free in Java, and not in C++).

    Cas :)
     
  8. Fabio

    Original Member

    Joined:
    Sep 30, 2005
    Messages:
    499
    Likes Received:
    0
    Nobody is more blind than who doesn't want to see.

    You wanna think Java is instrinsecally faster than C? Fine. :D

    Me, John Carmack, Linus Torvalds and millions of other idiots are wrong. Ok! :rolleyes:

    There isn't the slightest problem with that, you know? :cool:
     
  9. princec

    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    4,873
    Likes Received:
    0
    Actually Fabio a little google searching will find me quoting that Java is approximately 50-80% of C++ in typical game usage. The thread was about the fact that it takes far, far less time and effort to produce excellent code in Java or other "next-generation" languages than in C++.

    Cas :)
     
  10. svero

    Moderator Original Member Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    3,392
    Likes Received:
    6
    Looks like this thread has had it's day....
     
Thread Status:
Not open for further replies.

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer