Yesterday I finally started to play with 1.3b1 release of java3d and
found out that same problems are still there.

Here is top part of hprof
1 20.50% 20.50% 3496000   656 java.lang.System.arraycopy
2 11.63% 32.14%     874   627
javax.media.j3d.GeometryArrayRetained.setupMirrorInterleavedColorPointer
3  8.08% 40.21%  873311   670 SwarmExample.updatePosition
4  6.81% 47.03%     874   615 ParticleHandler.updateParticles
5  5.94% 52.97%  764150   650 ParticleHandler.setPosition
6  4.93% 57.89%  764150   624 QuadParticles.setPosition
7  4.79% 62.68%  873311   665 SwarmExample.updateVelocity
8  2.08% 64.76%     876   674 javax.media.j3d.GeometryArrayRetained.execute
9  2.03% 66.79%     874   620
javax.media.j3d.GeometryArrayRetained.computeBoundingBox


1) You still use System.arraycopy to copy 4 color data for each single
vertex.

TRACE 656:
java.lang.System.arraycopy
javax.media.j3d.GeometryArrayRetained.setupMirrorInterleavedColorPointer
javax.media.j3d.GeometryArrayRetained.updateData
javax.media.j3d.GeometryArray.updateData

As you can see it uses about 20% of time in my test program. Please
maybe change it to 4 manual copies (x[i] = y[i];...; x[i+3] = y[i+3]; )
- I have done small benchmark - under hotspot, it is 8 times faster than
arraycopy version (so I suppose that arraycopy will show it's strength
from around 30-40 elements, or for objects requiring casting).

2) Why color data is copied at all ? I'm certainly not an opengl guru,
but AFAIK it is possible to have interleaved array with ALL data inside.
  I use COORD|COLOR_4|BY_REF|INTERLEAVED geometry with float[] data. I
know that this is an implementation detail and should be in theory of no
concern to me, but it makes for about 30% of time spend in my program -
and that's painful... If it is really needed in this case, please give
me a hint how to avoid copying. Will same thing happen also with
J3dBuffer ? And if it is really unavoidable, please fix point 1- at
least it will reduce time from 30% to something like 12%.

3) This one is new in 1.3 IIRC. At place 9 we have computeBoundingBox. I
explictly set off setAutoComputeBounds for this shape. But it still
seems to run every frame.
TRACE 620:
javax.media.j3d.GeometryArrayRetained.computeBoundingBox
javax.media.j3d.GeometryArrayRetained.computeBoundingBox
javax.media.j3d.GeometryArrayRetained.processCoordsChanged
javax.media.j3d.GeometryArrayRetained.updateData
javax.media.j3d.GeometryArray.updateData

This one is not performance critical, but still puzzling.

If you need any additional info, program used to test it or anything,
please contact me. I have run tests on WinXP Pro, Geforce 256, nvidia
detonator xp 12.83, jdk1.4b3, java3d 1.3b1-opengl.


Artur

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to