Going as low as possible without JNI

I’m attempting to build my own little library for my physics engine/game where I’m trying to do everything from as low as possible.

I have couple of performance questions:

Is it true that Canvas3D negates all the bonuses achieved from Fullscreenmode since it is heavyweight?

Is there any way to disable the innate AWTEvent processing and implement your own on top of it? The way I see this, it would give a nice speed boost to customize the code work with the rendering engine and FPS update interval.

What internat threads can be accessed by the program? It would help a lot if I could implement one of those internal threads to do the input monitoring and perhaps the game physics(collision detection). This would leave the main game thread totally free of unneccescities.

Does anyone have any tips and tricks what to do to get the optimal performance by tweaking the innate processes without JNI?

No.

Just don’t produce events. Then the event thread just sleeps. I’ve never heard that the event thread itself produced any noticable load.

It already does. That’s the event thread.

Physics in the input processing thread? Normally physics runs as an integral part of the gameloop and does not count under ‘unneccescities’.

Just use them, they are fine.

They are fine, arguably.

Can someone tell me why not to use AWTEventListener and eventDispatched, on suns site it says that it is kind of slow and should not be used, why is this so? I would have only two three kinds of events to dispatch, those from mouse and those from keyboard.

What does the java3d behaviour use to get the events?

Do you have a link to where Sun’s talking about the event thread?

Sun is talking about the AWTEventListener:

http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/awt.html

If you mean if I got the link where the event thread is explained then no.

This is pretty distressing. And, of course, pretty vague.

[quote]This is pretty distressing. And, of course, pretty vague.
[/quote]
Quite so. Apparently it is best to experiment for best performance.

YES! eventDispatched is faster if you have only few listeners launching elements, such as mouse and keyboard, but with many, there is no speed difference, in fact it is slower.

I’m not totally through with the experiments yet, but this seems to be the case. At least on my computer.

I used java 3d timer to get count the time spend in each event.

I’ll post here when done.