Hi,
I'm writing a contouring package on top of Java 2 and am running into
performance problems. Taking a regular grid and splitting it into rectangles
and triangles all works and takes < .5 sec to generate. (20 x 20) grid.
This produces approx 1600 shapes to be rendered to a 500x500 pixel display.
I'm using Rectangle2D for rects, and GeneralPath for triangles.
Fills are all solid color. I reuse the same Rectangle and GeneralPath and
just
swap out the geometry as needed. Rendering just looks like
Graphics2D.setColor(whatever);
Graphics2D.fill(rect);
Graphics2D.draw(rect);
same for triangles.
It takes >10 secs to render on my 266 Pentium box.
So I thought I'd see where all the time goes. Attached is a program that
draws 1000 random rectangles. Running this through OptimizeIt shows that
1000 calls to Graphics2D.draw takes 5.5 secs
and 1000 calls to Graphics2D.fill takes 7.7 secs
Optimizeit shows that there is quite a lot of setup costs involved in each
rectangle render.
What can we expect in the way of speed increase from 1.2.2 ?
Graeme Wallace
Technical Director
Interactive Network Technologies
2901 Wilcrest Drive, #100
Houston
Texas, 77042
Tel: 1 713 975 7434
Fax: 1 713 975 1120
Email: [EMAIL PROTECTED]
WWW: http://www.int.com
Application.java