Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Performance Tuning / Re: New VM performance improvements on: 2004-11-28 21:06:20

And yet often it can't.

According to some message that I just read on the Mac java-dev mailing list basic classes like ArrayList can't have the set(), get() or add() methods inlined properly due to the way the bounds check works. (Something to do with the way the out of bounds exception is thrown.)

Man, ArrayList OWNS it's iterator... you'd think bounds checking would be unnecessary in that situation. I guess it's an either on or off check :|
2  Game Development / Performance Tuning / Re: New VM performance improvements on: 2004-11-28 11:59:25
Poor things. And they're so ugly, too Sad

After you've been doing OO for a very long time you begin to realise really what OO is all about. The big wet-fish-in-the-face surprise is that the dot operator

dots I could do without.... well for method calls anyways. Hotspot should [bold]ALWAYS[bold] inline a getter which should most likely be private 99% of the time anyways. Ask, don't tell

3  Game Development / Performance Tuning / Re: Odd performance observation on: 2004-11-27 06:25:01
Maybe Windows swapped out the process during the sleep, hence it had to take time to swap it back in.

Interesting thought.....

I run with no swap. For the purposes of this exercise, I did configure a 1 gig swap space to make sure that the no swap space configuration was not at the root of the problem. That said, I suspect that XP silently configures some minimal amount of swap space that you can't eliminate.

Although I didn't note any disk activity during the test, I wasn't expecting any and didn't watch as closely as I should have Roll Eyes. I just re-ran the test and this disk was fairly (but not 100%) quiet during the run. So it would seem as though the running process does trigger some extremely small amount of disk activity. This leads me to believe that everything may be sitting in (disk) cache and given that the system is otherwise idle, this amount of disk activity is only enough to trigger a sporadic read/write operation.

So, if the process is partly swapped out but only to disk cache (speculation here), then that might account for some of the difference. That said, I'm not sure that it should/account for a more than doubling of the timings.

I just had a run on a Mac and those numbers looked pretty clean so it's looking more and more like this behavior is unique to XP.

4  Game Development / Performance Tuning / Odd performance observation on: 2004-11-26 17:27:16
Ok, this isn't a gaming related observation but it is performance related. What I have is a benchmark that has been run by several people in a number of different environments and JDKs. The list includes HP-UX, Solaris 5.9, Mandrake linux, SuSe Linux, W2K, and XP. JDKs include 1.4.2_02, 1.4.2_04, 1.4.2_5 and the latest 1.5.0.

What I did was setup a micro-benchmark (Jeff hold your tongue, I know it's a loaded weapon pointed at my foot Smiley) to look at the performance of the new for loop. I totally expected that the run times and memory profiles for each scenario would looke the same and those were the results that I got. What I didn't expect to see was some strange numbers on my XP box. First to explain the test.

- setup fixtures for the test
- run the test to pre-heat the VM
- call System.gc();
- call sleep( 1000);
- repeat many times
     - run the test (start timer, test, stop timer)
     - call gc
     - sleep

When I run this test in XP, I see a run time of about 200ms. This is result is repeatable in other XP environments and does not seem to depend on the version of the JDK.

If I eliminate the sleep, the run time DROPS to about 80ms (and no, the sleep is not in the metered section of code).

When I run this test on any of the other hardward/OS combinations, the numbers look ok.

So as bizzare as it sounds, some how, in XP, calling sleep affects how the thread will run AFTER sleep has long finished. I've looked at Java thread priority and it's rock stable at 5. I can't see how it can be a thread scheduling problem coming out of sleep since the thread is needs to be running to start the timer and perform the unit of work.

So the question here is, does anyone have any idea what might be going on?
5  Game Development / Performance Tuning / Re: New VM performance improvements on: 2004-11-26 17:09:33
I'm an OO bigot too Smiley

We don't need member variables to be public, we need them to be accessible without get/set

humm, not public yet accessible.... you don't mind if I don't point out the contradiction on that statement will you??? ooops, I already did  Shocked

and oh, not being 'merican.. I almost forgot, happy turkey day
6  Game Development / Performance Tuning / Re: New VM performance improvements on: 2004-11-26 14:05:13
I don't suppose you'd care to champion Structs with me?

Cas Smiley

In a nutshell... not as they are currently defined. But what I would champion with you is the ability of NIO to paste objects into a buffer giving that buffer structure. This is a low level feature that does have some interesting possibilities.
7  Game Development / Performance Tuning / Re: New VM performance improvements on: 2004-11-26 13:19:16
You probably don't see a use for ints then either...

I wish I hadn't called them Structs now, because they are so not like C-structs at all.

Well, unless I've misunderstood what I've seen... these structs to look very C like in that there is space for shape but now for methods. As for getters/setters, I guess you could opt for public instance variables. The problem that I see is that public runs counter to encapsulation. That said, we do sometimes need to violate encapsulation for performance


When you see the hairy code we have to write to do OpenGL you'll understand. The worst bit is, even though it's hairy, it's still 50% of the speed of the C version Sad

Well, when I think back on some of the bit twiddling that I needed to do, if was one instance were OO just didn't seem to fit or at least I couldn't seems to satisfy the demands of OO and performance. Needless to say that performance needed to win and it did and OO was tossed on that particular effort. When we tossed OO, we also opted for C and FORTRAN in favor of Smalltalk (the OO choice at the time). For some reason, I just can't see myself choosing Java over C in the same situation and I am an OO bigot  Grin
8  Game Development / Performance Tuning / Re: New VM performance improvements on: 2004-11-26 05:55:11
I fear that Structs are a hot potato.

But that, in a nutshell, is why I think no-one has replied yet. Not even Azeem...

Cas Smiley

I see no use for structs in an OO based langauge. Structs are data with no behavior. Where do you put the behavior? How do you control the state?

I think what you are really asking for is the ability to use the shape of an object to define structure with-in a buffer or mmap'ed area of memory. This does not require a change in Java to achieve.

I am currently activily arguing against ANY changes to the Java language specification BEFORE we fully understand the implications of the change. I'm not interested in a pro/anti generics descission as this is not the forum for it but.... I will use it as an example where the JCP jumped the gun in dropping in a flawed version of a change to the language and now that we have it, it is practically impossible to go back. I would suggest that changing a language is not something that the average programmer has enough knowledge to offer an expert opinion on how to extend a language. I, myself, do not claim to have enough knowledge to offer an expert opinion on how to extend any language. That said, what I do know is that more language features = more choice = more complexity = more problems. The thing that is wonderful about Java is that it does offer a syntax that approaches Smalltalk in simplicity but offers syntax and concepts that make is less foreign to those that need functional structures in order to  work.

9  Game Development / Performance Tuning / Re: VM bytecode tuning on: 2004-11-26 04:20:21

You mean you got rid of the startbar, the desktop, everything?

Yup but don't ask me why the auto-restart doesn't
10  Game Development / Performance Tuning / Re: VM bytecode tuning on: 2004-11-25 17:30:25
I believe Shirazi has done such opcode micr0-benchmarking.

You might check his site as it soudsn like you have one of the rare projects (byte code generators) where this is actually useful information.  Keep in mind though you'll have to track it for changes over VM versions :/

Ok, long time learker, first posting. I can safely say that my partner in crime has not done this type of benchmarking. I normally do that level of benchmarking and the last time that I did this was in an attempt to validate some of the tips in our tips database. I can safely say that I could not see any precevable differences between either technique.  Later on I discovered that the compiler may have "optimized" my benchmark for me... As the saying goes.. beware the microbenchmark    Grin   I still do them and I believe that they are useful but man can you get stung really badly if you're not careful.

For example, I almost blogged a 1.5 MBM that I did the other night I was in the middle of the write up and a I had a nagging question. So, I went back in and tried a twiddle with the benchmark only to discover that the alteration resulted in a 60% reduction in run time. Ran the benchmark baseline in the 1.4.2_04 only to see the same effect.

The bizzare thing is; the twiddle was the removal of a call to sleep that occured after a forced GC and these calls are made outside of the metered section of code! Furthermore, because I didn't force a full GC at controlled points, it ran during the metered portion of the code.

I'm currently wondering if the thread priority has been set in XP such that it's often interruped after sleeping. That said, I shutdown just about everything running on the machine before starting the benchmark (including explorer Smiley)

While writing this, I finished a test in W2K only to discover that the effect appears to be absent. So it would seem that this effect is a JVM/XP interaction. :-/
Pages: [1]
EgonOlsen (47 views)
2018-06-10 19:43:48

EgonOlsen (29 views)
2018-06-10 19:43:44

EgonOlsen (49 views)
2018-06-10 19:43:20

DesertCoockie (214 views)
2018-05-13 18:23:11

nelsongames (130 views)
2018-04-24 18:15:36

nelsongames (129 views)
2018-04-24 18:14:32

ivj94 (870 views)
2018-03-24 14:47:39

ivj94 (131 views)
2018-03-24 14:46:31

ivj94 (782 views)
2018-03-24 14:43:53

Solater (146 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!