You may end up having to profile the J2ME application running in the emulator rather than an actual PDA or phone. Bill

kumar Reddy

Greenhorn

Posts: 29

posted 14 years ago

hi Thanks for reply..but i could not completely understand your reply....

Is there any difference in profiling the J2me applications in emulator and PDA?

say if i install an emulator and then i will install j2me and my application..could you please let me know how can i profile the j2me application installed on emulator with already existing tools..for ex jprobe, optimizeit,jview2004 etc..

sorry if my question seems to be silly..but i am really new and could not get the starting point to profile.

hope you can help me in this regard

thank you

William Brogden

Author and all-around good cowpoke

Posts: 13078

6

posted 14 years ago

The problem is that a PDA or phone does not have the resources to support a profiler and your application at the same time. For example, a profiler may need to write huge amounts of event data to a file. However, if you can find an emulator program that runs on a regular desktop PC, you can have the profiler watch the emulator as it executes your application. It has been some time since I did this, but the latest Wireless Toolkit from this Sun website should support this sort of thing. You will also find other handy information at that site. Bill

kumar Reddy

Greenhorn

Posts: 29

posted 14 years ago

hi

That was really a good reply. i gone thru the link that you have given and explored a little about emulators and the way they function.lets keep profiling aside for sometime.

what i came to know from my short research is that there exists two types of emulators which are concept emulators and real-life emulators.

"Another way of looking at the world of emulators is to divide them into concept emulators and real-life emulators. A concept emulator does not represent a specific device but serves to demonstrate the general characteristics of a certain kind of device. The J2ME Wireless Toolkit emulator, for example, is a concept emulator that can be used to represent a variety of MIDP devices. A real-life emulator is designed to mimic the appearance and behavior of an actual device. Such an emulator may run some or all of the binary code that runs on the device itself. " -- taken from http://developers.sun.com/techtopics/mobility/midp/articles/emulators/

i dont know whether you have heard of "VMWare" which is also just like an emulator that can be installed on a pc and it gives us a new pc environoment with its own harddisk,memory,frequency etc..

so i would like to know if there is any emulator that resembles an PDA.i mean that the applicaion running in emulator should not take up the resources of the system that it was installed on. instead it should take up the resources of the emulator..thereby giving me a real environoment for running my j2me applications.

scenario is i dont install jdk,j2me etc on my pc. i install only my emulator..i should have an option to install j2me on emulator and execute the application . and whenever the emulator is closed , the j2me should be uninstalled automatically(this option is available in "VMWare").

could you please comment about this. I am sorry if i am not clear. please help me in this regard.

thank you

William Brogden

Author and all-around good cowpoke

Posts: 13078

6

posted 14 years ago

That is a good point about the two kinds of emulator, however, I think that even with the "comcept" emulator, the way your application code executes should be similar between J2ME versions, and general Java performance considerations should apply.

Do you have a real performance problem in mind, or is this general research? Bill

kumar Reddy

Greenhorn

Posts: 29

posted 14 years ago

hi

I am currently in research phase after which i should be able to test my j2me applications in the real environoment.

The only thing we are striving is to follow the rule of performance gurus that "THE APPLICATIONS SHOULD BE TESTED IN REAL ENVIRONOMENT".

as said by you,yes we can trace the performance problems even when we run on the emulators which takes up the resources of host operating system.our concern is to find out whether the limited hardware resources on PDA's are gonna play some role in performance of the applications.

so could you please give me a suggestion on this?

is my idea wrong of trying to find performance problems executing them in real environoment?

Thank you

William Brogden

Author and all-around good cowpoke

Posts: 13078

6

posted 14 years ago

You are absolutely right about testing in the real environment, but you don't need a profiler for that! It is the user's perception under real use conditions that is most important. If you can get something useful up on the screen in a hurry, it may not matter that behind the scenes you are working frantically to parse some xml.

In the first version I tried, I used String methods to dynamically figure out wordwrap on that tiny screen - it crawled! It would have been very frustrating to the user. The solution was to precompute all of the text lines when creating the application.

So by all means, test in the real environment, but you need a stopwatch, not a profiler.

Originally posted by William Brogden: So by all means, test in the real environment, but you need a stopwatch, not a profiler.

A stopwatch actually might still measure the wrong thing. Something can already *appear* to be faster just by showing a progress bar!

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus

William Brogden

Author and all-around good cowpoke

Posts: 13078

6

posted 14 years ago

A stopwatch actually might still measure the wrong thing. Something can already *appear* to be faster just by showing a progress bar!

Ah - but if you are trying to optimize user perception of performance, that is the right thing to measure. Bill

kumar Reddy

Greenhorn

Posts: 29

posted 14 years ago

hi bill and ilja nice to see ur answers.. ok let me explain my view..but before that i am sorry if i am wrong..

"i did not get why u were mentioning progressbar" .. because its only for feeling pefromance not for improving the acutal peformance of code u have written.

"regarding stopwatch" .. i understood in two ways

First

To start application on pda and measuring the time taken using a stop watch .. but does that give you the exact statistics that JPRObe or optimizeit gives for applications running on PC?

if thats case then why need to buy the commericial profilers..everyone can measure with stopwatches..

Second:

"first to find out the performance bottlenecks on an emulator and solve them and deploy them on the handheld devices and test them in handheld devices with a stopwatch.."

say if i find performance bottlenecks using emulator and improve them and install the improved on the real handheld..is it guranteed that the improvement is reflected?

because i tried to run the same method on PDA and emulator.. on PDA--say 8 ms with an emulator -- it was 10 ms (surprising)

so what is feel is the emualtors are not worthy for testing the j2me applications

hmm i am totaly new and am not able to get these perfromance concepts..hoping that you can help me in this regard.

thank you

Ilja Preuss

author

Posts: 14112

posted 14 years ago

Originally posted by kod red: "i did not get why u were mentioning progressbar" .. because its only for feeling pefromance not for improving the acutal peformance of code u have written.

Well, you most probably want to improve user satisfaction, don't you? And you want to get maximum satisfaction for minimal investment (else your users will be dissatisfied by the price of your product). Sometimes a progressbar is better in doing this than actually improving code performance.

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus