Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
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  
  little speed comparisson  (Read 1332 times)
0 Members and 1 Guest are viewing this topic.
Offline Raghar

Junior Member




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


« Posted 2004-01-08 16:36:52 »



there is a little comparison between c++/c, ASM, and Java.

It looked interesting so I decided to post it.

It should be noted that c++ was connected into java by JNI, and ASM library was connected into c++ library. Also on backgroud were running QCD 3, antivirus, and firewall. Test CPU was medochino/dixon (would you believe windows or linux?) overclocked to 453 MHZ


bin\java -server -Xcompile -Xmx1200M jn
 4   first attempt 40 second attempt 40 full 160   first attempt 0 second attem
pt 0 full 160   first attempt false second attempt  first attempt 144 second att
empt 144 full 160    40

So try to guess what is what. First attempt and second attempt are just control checksums. Timing is that number after full.


All test were done for same task array multiplication. C++ and ASM uset the same array, java used different. (I tried to disalow unpredicable JNI actions)




bin\java -server -Xcompile -Xmx1200M jn
 4   first attempt 40 second attempt 40 full 160   first attempt 0 second attem
pt 0 full 110   first attempt false second attempt  first attempt 144 second att
empt 144 full 160    40


this was second run.
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #1 - Posted 2004-01-08 17:03:58 »

eehhh  Huh

care to make some sense and post some clarification or some code or something?

Offline cfmdobbie

Senior Member


Medals: 1


Who, me?


« Reply #2 - Posted 2004-01-08 18:51:04 »

+1  Grin

Hellomynameis Charlie Dobbie.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Raghar

Junior Member




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


« Reply #3 - Posted 2004-01-08 20:37:39 »

Speed test      C++, ASM, Java

Results first test  160/160/160 ms
second test          160/110/160 ms

basicaly it was something like this

int[] integer=new int[20000000] //it was inicialised to some number

store time
for (int q=0;q<integer.lenght;q++){
integer[q]*=10;
}
print time

quite interesting if you consider that C++ code was generated with /O2 /On flags. If I didn't botched something. One of results is hotspot actually could do array multiplication quickly
Offline Jeff

JGO Coder




Got any cats?


« Reply #4 - Posted 2004-01-09 05:45:35 »

Fairly old news, that.

See Shawn's more involved real-world math tests for results I have a bit more confidence in.

I won't go into all the myriad things you need to be careful of to make a test like this even slightly valid *AGAIN*.  Search the boards for the term "Microbenchmark" over the last year and you'll see them all.


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
Offline crystalsquid

Junior Member




... Boing ...


« Reply #5 - Posted 2004-01-10 15:03:18 »

All you are measuring here is the memory cache & bus performance. The work done in the inner loop is so trivial that the read/writes will far outweigh the cost of a multiply - whatever language you use.

- Dom
Offline Raghar

Junior Member




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


« Reply #6 - Posted 2004-01-16 16:41:21 »

This was exactly what I measured. Bus speed. Then when I was in testing,  I even measured mul instruction. It was 170 GPI, but I did it just in ASM. (Too many possible optimalisation in JVM. And TOO ugly code in VC6 enterprise)
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.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (19 views)
2014-09-24 16:12:06

Grunnt (45 views)
2014-09-23 14:38:19

radar3301 (27 views)
2014-09-21 23:33:17

BurntPizza (63 views)
2014-09-21 02:42:18

BurntPizza (33 views)
2014-09-21 01:30:30

moogie (41 views)
2014-09-21 00:26:15

UprightPath (50 views)
2014-09-20 20:14:06

BurntPizza (54 views)
2014-09-19 03:14:18
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!