Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subject: JDK 5: No acceleration?



are you enabling quartz extreme via Quartz debug application?

if so what the difference between quartz extreme and quartz extreme 2D?

and what should someone enable to have better performance?

thanks


On Apr 30, 2005, at 2:20 PM, Shawn Erickson wrote:


On Apr 30, 2005, at 8:05 AM, Sean Luke wrote:


On Apr 30, 2005, at 10:26 AM, Dmitry Markman wrote:



we have very complex molecular dynamic simulations
and I can not see any thing close to 10% of 1.3.1 slowness


Java 1.4.2 is very _very_ slow at drawing.


Well look at the following results when using the attached code which draws 1 million lines (times in milliseconds)...


(PM G5 Dual 2GHz, 6800 GT with 256MB, and dual 23" displays running at 1920x1200x32)

With Quartz 2D Extreme disabled (the default for 10.4)...

[Session started at 2005-04-30 11:12:40 -0700.]
Java Version:1.4.2_07
OS Version:10.4
8899
8499
8688
8914

With Quartz 2D Extreme enabled...

[Session started at 2005-04-30 11:13:46 -0700.]
Java Version:1.4.2_07
OS Version:10.4
466
308
308
316
311

Note I modified your original code to move the random number calculation used to pick points to outside of the drawing loop which is being measured. Also I commented out all of you hint, etc. stuff.

import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import java.awt.*;

public class TestJavaDraw
{
    public static void main(String[] args)
{
        //System.setProperty("com.apple.hwaccel","true");

System.out.println("Java Version:" + System.getProperty ("java.version"));
System.out.println("OS Version:" + System.getProperty ("os.version"));


final JFrame f = new JFrame("Example");
f.setSize(400,400);
JButton b = new JButton("Press Me");
f.getContentPane().add(b,BorderLayout.NORTH);
f.show();
b.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
Random r = new Random();
Graphics2D g = (Graphics2D)(f.getContentPane ().getGraphics());




//RenderingHints hints = new RenderingHints (RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED);
//hints.put (RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_N EAREST_NEIGHBOR);
//hints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
//hints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
//hints.put (RenderingHints.KEY_ALPHA_INTERPOLATION,RenderingHints.VALUE_ALPHA_INT ERPOLATION_SPEED);
//g.setRenderingHints(hints);


g.setColor(new Color(r.nextInt(256),r.nextInt (256),r.nextInt(256)));

                int lineCount = 1000000;
                int pointCount = lineCount * 4;

                int[] points = new int[pointCount];
                for(int i=0; i < pointCount; i++) {
                    points[i] = r.nextInt(400);
                }

long l = System.currentTimeMillis();
for(int x=0; x<lineCount; x+=4) {
g.drawLine(points[x], points[x+1], points[x+2], points[x+3]);
}


                System.out.println(System.currentTimeMillis() - l);
        }
                            });
}
}



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

Dmitry Markman

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Subject: JDK 5: No acceleration? (From: Sean Luke <email@hidden>)
 >Re: Subject: JDK 5: No acceleration? (From: Dmitry Markman <email@hidden>)
 >Re: Subject: JDK 5: No acceleration? (From: Sean Luke <email@hidden>)
 >Re: Subject: JDK 5: No acceleration? (From: Shawn Erickson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.