Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (527)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (593)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Comments on another benchmark?  (Read 2134 times)
0 Members and 1 Guest are viewing this topic.
Offline Bombadil

Senior Devvie





« Posted 2004-01-17 13:16:43 »

Another one of these <insert your favourite word here> benchmarks:
http://www.tommti-systems.de/main-Dateien/reviews/languages/benchmarks.html

If someone would point you to this one and say "See, C++ is still many times faster than Java" - what's the correct answer please? (I'm no benchmark expert, just a Java fan.)
Offline crystalsquid

Junior Devvie




... Boing ...


« Reply #1 - Posted 2004-01-17 13:32:38 »

Except for the trig scores (again) most of the tests seem to be only 10-15% faster in the C versions, which is what most people say anyway.

Im dubious about some of their tests - their matrix multiplies were way half the speed of the C ones, which doesn't sound right to me, and the hashmap 's' test has Java as double the speed of C++, which suggests they are using completely different algorythms.

It looks about as useful as any other benchmark Ive seen - i.e. not very at all.

The interesting quote is:
Quote
In my opinion it goes much faster to develop complex apps with Java or C#, than with plain Cpp and the STL. Type safety and buffer overrun issues are also much weaker in Cpp, so you have to do more work, which takes more time and will cost some speed! So every language has its strong areas, but as always, nothing comes for free...


There you go. Profiling & specific algorithm optimisation is far more important for execution speed, Language features for development speed, and Benchmarking for filling up empty web pages.

- Dom
Offline Jeff

JGO Coder




Got any cats?


« Reply #2 - Posted 2004-01-17 19:24:52 »

Thats a great quote CS, I may quote you sometime Smiley

Thsi is the biggest problem with Microbenchamrks and why ocassionally you hear me react somewhat frustrated.

They are easy to write, most often wrong in terms of conclusions, and take a lot more work to explain WHY they are wrong then they did to write.

If I was going to try to debunk all the worthless "benchmarks' out there it would be a full time job.  Look at all the comments on past microbenhcmarks that are already here and see how many apply, probably a lot of them do.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Raghar

Junior Devvie




Ue ni taete 'ru hitomi ni kono mi wa dou utsuru


« Reply #3 - Posted 2004-01-17 21:26:04 »

Strange when other people write benchmarks, Java is slower than C. When I write benchmark Java is comparable with ASM. Perhaps it's just way how do you aproach this thing.

Quote
Original Source Code is from Christopher W. Cowell-Shah http://www.cowell-shah.com/research/benchmark/code and from http://dada.perl.it/shootout/ and Doug Bagley http://www.bagley.org/~doug/shootout . I took portions and whole parts from both and put them into a single file and did some changes + bugfixes.

Well he admits this. So all that current benchmarks were based on that old Doug code.



It's funny if  C++ is faster than Java by around 15/100, then that's acidentaly the same value as is ASM faster than C++.

Such benchmarks could be more interesting if they wouldn't use FileReader/Writer.


As to B question. This bechmark measured different things so it's just partialy valid. Also he is unexperienced with Java, and possibly in C++ (I hate when I'd have to repair programs screwed by someone else). Actually if we would ignore sin/cos tests, Java was faster in four cases.

C++ has unprecise sin, Java uses more perfect way. So he compared two method with two different results. We could be nasty and say C++ method doesn't have high enough precision so C++ failed this test.  JET failed as well.  
Remmember that old joke about Intel and Motorola? How much is...

On my computer trig math completed in (scaled towards his test) 6000 ms. True this is twice as much as C++, but it's uninteresting for real game.
Interesting for real aplication is that correct double results of sin and cos are avilable.
0.990665  vs 0.9906646477361263

it might be interesting if typing sin() without Math or StrictMath would activate native instruction "where avilable" with possibility of as bad results as could be on Intel processors.
Offline Bombadil

Senior Devvie





« Reply #4 - Posted 2004-01-19 07:06:23 »

Good thoughts on that benchmark topic, again. Thanks.

So, if somebody with spare time knew how to tune Java it should be possible to do a similar shallow benchmark (for all those "C++ benchmark fans" out there) which shows that Java "is faster than C++"...
I don't need such one, because I'm interested in real applications, but regularly I meet people liking shallow benchmarks. It would be nice to be able to present them such one.
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #5 - Posted 2004-01-19 08:05:21 »

So you really want to participate in such a religous cake fight, huh?  Grin

Maybe some useful tips:
* Use the slowest C++ compiler you can find and make sure you don't use any optimization options.
* Use an algorithm to benchmark which java is particulary good at, such as FFT.
* Use an algorithm to benchmark which C++ is particulary bad at (force some cache misses for example).
* Use the JRE or even aot compiler which is fastest for that algo. Maybe use a different JRE for every benchmark if necessary.
* Optimize your java code to death, but absolutely don't in the C code.

Wink

You could also write a cool game and say you could never have pulled it off in the amount of time spent using C++ and brag about being 100% sure you don't have any memory leaks in your code.

Offline Bombadil

Senior Devvie





« Reply #6 - Posted 2004-01-19 10:00:49 »

Quote
So you really want to participate in such a religous cake fight, huh?  ;D

No. ;-)  I just would find it handy to be able to show friends (C++ programmers) and others, that Java is ready for fast applications / games. All they find on the Net are these vague benchmarks.
Unfortunately Doom99 written in Java isn't ready yet, so I can't convince them with "hard facts" (=macro benchmarks) so far...

Quote
* Use the slowest C++ compiler you can find and make sure you don't use any optimization options.

Well, these mentioned guys would take care of the C++ optimization themselves. ;-)

Quote
* Use an algorithm to benchmark which java is particulary good at, such as FFT.

FFT is too much for me. Pathfinding would be suitable, too, I read. I'll have to check the few pathfinding threads to see which algorithm fits best to Java.

Quote
You could also write a cool game and say you could never have pulled it off in the amount of time spent using C++ and brag about being 100% sure you don't have any memory leaks in your code.

Yes, but then I'd have to wait some years...
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #7 - Posted 2004-01-19 10:37:38 »

So then, why not show off some games to demonstrate how capable java is for fast games without creating benchmarks?
* Wurm online
* That enhanced Quake demo by reality interactive (the link is somewhere on this forum)
* Alien Flux
* Flying Guns (hey, it even uses that 'slow' Java3D).
* of course there's more but I can't think of them right now.

Erik

Offline princec

« JGO Spiffy Duke »


Medals: 425
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #8 - Posted 2004-01-19 11:46:50 »

and the old old old Shaven Puppy terrain demo, which is probably the original eye-popper for Java performance critics.

Cas Smiley

Offline Bombadil

Senior Devvie





« Reply #9 - Posted 2004-01-19 12:20:17 »

Commercial game (C++) programmers are more interested in macro benchmarks and such. If they see "trig benchmarks" with Java taking 200% of the C++ one they're thinking "OK, let's wait for another Java generation"...

Of course I explain them that it's been a silly benchmark and compared apples (Intel precision C++ trig routines) with ... chocolate (Javas higher precision trig routines), but still...

Maybe I could take Cas' Java implementation of A* and see how it compares to a C++ implementation... Did anybody do this already?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline AndersDahlberg

Junior Devvie





« Reply #10 - Posted 2004-01-19 15:20:32 »

Maybe this, http://www.jroller.com/resources/rickard/FFT.java, could be an interesting start to a FFT implementation to compare with a "regular" (non-optimized;) c++ version?
Offline Jeff

JGO Coder




Got any cats?


« Reply #11 - Posted 2004-01-20 22:32:45 »

An old but well done set of benchmarks doing real tasks:
(You really need to read the details to understand it, dont just look at the pictures.)

http://www.aceshardware.com/Spades/read.php?article_id=153

An updated run of these benchmarks, though not as complete:

http://members.lycos.co.uk/wjgoh/Java%20vs%20C%20benchmarks.doc

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

toopeicgaming1999 (73 views)
2014-11-26 15:22:04

toopeicgaming1999 (63 views)
2014-11-26 15:20:36

toopeicgaming1999 (15 views)
2014-11-26 15:20:08

SHC (29 views)
2014-11-25 12:00:59

SHC (27 views)
2014-11-25 11:53:45

Norakomi (32 views)
2014-11-25 11:26:43

Gibbo3771 (27 views)
2014-11-24 19:59:16

trollwarrior1 (40 views)
2014-11-22 12:13:56

xFryIx (78 views)
2014-11-13 12:34:49

digdugdiggy (57 views)
2014-11-12 21:11:50
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!