Skip to main content

a strange problem for performance

1 reply [Last post]
frankzh
Offline
Joined: 2007-02-07
Points: 0

I built two versions based on win32 platform (default flags):
1. CLDC for Sun's RI
2. CLDC for phoneME
I tested their performance and found phoneME has worse performance than Sun's RI. It took 125s on phoneME and took 71s on Sun's RI. I think there is something wrong with my building. Can somebody give me some suggestions?

The following is my testing source java file:

import java.util.Date;

public class LoopTest
{
public static void main(String[] args)
{
Date before = new Date();
System.out.println(before.getTime());
double num = 0;
for (int i = 0; i < 65535; i++)
{
num += i;
}
Date after = new Date();
System.out.println(after.getTime());
StringBuffer buf = new StringBuffer("loop run for ");
buf.append((after.getTime() - before.getTime()));
buf.append(" milliseconds!");
System.out.println(buf.toString());
}
}

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
terrencebarr
Offline
Joined: 2004-03-04
Points: 0

Frank,

A similar question was just posted. See my reply at:

http://forums.java.net/jive/thread.jspa?threadID=22722&tstart=0

-- Terrence