> Hello down below is a question regarding java and 3d
> visualization on jmol mail list. I got your contact in
> an answer and would like to ask you for any
> advice and opinions on the matter. Thanks
>
> Question:
>
>  Hello, me and some of friends are planning to write a
> molecular visualization tool with some properties. It
> still though will be a molecular visualization tool,
> mainly. What I am most interested in is javas
> performance in graphics.

I got involved in Jmol in late 2000. At that time Jmol used the Java2D
graphics library that is part of the standard Java runtime library.
Performance was quite poor. Rendering of a few hundred atoms (circles) was
very slow. The painter's algorithm of painting back-to-front made
intersections between objects incorrect. It was clear that the graphics
engine needed to be completely rewritten.

Java3D was unacceptable because that project was losing steam. JOGL did
not really exist, and (as I understand it) still has a number of problems
to this day.

Before embarking on writing a complete graphics engine I did extensive
evaluation of Java performance. I wanted to confirm that Java performance
for core graphics rendering operations would be acceptable.

I wrote a number of benchmarks to compare C performance with Java.
Basically, these routines rendered squares into an off-screen int[] that
was used as a buffer. I used squares as a substitute for spheres because
it was much easier/faster to implement.

These were tight loops performing array operations. It is exactly the kind
of thing that C is good at. It is also going to be the core of any
graphics engine.

> I have seen Jmol and it can do the
> visualization part quite smoothly. I was asking for
> opinions of other people
> and what I get varies greatly. Some say that java is %80-90 of
> C++ in terms of performance

I found that Java performance was 85-90% of C performance. I considered
this difference completely insignificant. Improving hardware performance
would make up for this within a few months.

I performed this evaluation back in early 2001. Since that time Java
compilers have continued to make substantial improvements. On the other
hand, C/C++ compilers topped-off back in the 80s/90s.

> and some say that java is a really bad choice
> for this kind of project...

My (blunt) perspective:

* anyone who would say that you should use C/C++ instead of Java has never
done any any serious software development on a large project

* I would never hire anyone to work for me who held this opinion

* I would have expected to hear this as late as 2002, but not in 2007

* C is a necessary evil for device drivers, but should be avoided whenever
possible

* Thread support (while still very complicated) is much more approachable
in Java than in C. This will become increasingly important over the coming
decades.

* I did systems programming in C/C++ from the late 70s through the late
90s ... I would never go back

> And the problem is that I know java much better
> than c++ ( although I have opengl experience in neither) and
> using java would speed up things greatly for me.

Java would speed up everything. The development/debugging cycle will be
greatly improved for the project.

Java will allow you to get the project out the door sooner ... the most
important/crucial part of any project.

> I would just like
> to ask the developers of jmol to give me their
> opinions on this matter of
> graphical performance and what libraries of java
> seem to work well for this purpose.

Let me be clear on this.

Performance of *Java* is perfectly acceptable.

Performance of the Java2D library is terrible. Do not make any Java2D calls.

I have no experience with JOGL performance, but would expect it to be
indistinguishable from C/OpenGL performance.

> And I know that the source code is available but at my
> current position I quickly need to decide to about the language
> first before acquiring the knowledge to understand opengl scripts.

This statement sounds like you plan to use OpenGL.

Jmol does not use OpenGL, and I have no experience with it.

If you need a graphics rendering engine for molecules then you may want to
consider using the Jmol graphics engine under LGPL terms.

If you want to use OpenGL, and the project is of reasonable size, then
investigate JOGL and use Java.

If you want to use OpenGL, and the project is simple (involving one person
for no more than 2 weeks) then it *might* be easier to do in C.


Miguel


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to