Featured Whitepapers
Newsletter sign-up
View all newsletters

Sign up for our technology specific newsletters.

Enterprise Java
Email Address:

J2ME devices: Real-world performance

Performance benchmarks can help device developers build better applications

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone

Page 3 of 7

In the kernel-level test, we pick up some of the common test areas for J2SE (Java 2 Platform, Standard Edition) benchmarks and add our own. In each test area, we execute a test-specific code in a loop. We receive the speed (loops per second) as the result. We built an application named JKernelMark (version 1.0, 10 KB), to perform the kernel-level benchmark.

In the application-level test, we define some test areas first. In each test area, we execute a test-specific code in a method. The speed (milliseconds per execution) is the result we receive. We built different benchmark applications according to different J2ME APIs: For J2ME standard APIs, we built an application named JAppsMark (version 1.0, 14 KB). For third-party APIs—XMLParser, for example—we built the JXMLMark application (version 1.0, 21 KB) to test XML-parsing performance using kXML.

Benchmark details

For each benchmark, a MIDlet suite application performs the benchmark in the real device. The following sections explain what we test in each benchmark application.

JKernelMark

JKernelMark tests the following:

  • Sieve: Arithmetic algorithm that generates the mathematical results with predefined mathematical expressions and conditions.
  • Loop: JKernelMark tests how VMs optimize loop operations. Again, this test is a mathematical algorithm, which outputs a mathematical expression's series of results. The benchmark puts the result into an array and reverses the array's sequence.
  • Logic: JKernelMark tests how fast the VM executes logic instructions. JKernelMark creates many Boolean flags and then reverses those flag values in loops.
  • String: Here, we test the speed of the virtual machine executing typical string operations. JKernelMark creates a StringBuffer, continues to append a string into that StringBuffer in loops, and then tries to find the specified substring's location.
  • Method: JKernelMark tests how fast the VM handles method calls. It calculates the sum of integers using recursive function calls.
  • Memory allocation and garbage collection: Here, JKernelMark tests the memory allocation speed and how garbage collection affects performance. It continues to create new objects and new arrays of bytes in memory (in each loop, it may create around 20 KB of objects in the heap). If the memory is not enough, the system will collect garbage and definitely affect the speed of allocating new objects.


JKernelMark score meaning: Loops per second; a higher score indicates better performance.

JAppsMark

JAppsMark tests the following:

  • Network communication: This test records the time required by a Java phone to make an HTTP connection to a Web-based system and read 200 bytes of information from the response. The test execution time also includes the network delay. If the test is unsuccessful, we receive test-failed status. Even though a mobile phone is J2ME enabled, you still need a SIM (Subscriber Identity Module) card with either data service GSM or GPRS (General Packet Radio Service) activated. There are other ways to configure the J2ME devices to conduct this test, which we don't highlight. For example, you can directly connect the handheld to a PC.
  • Low-level GUI: JAppsMark tests a Java phone's performance in rendering the graphics to the screen. This test involves loading an image file and painting it on a canvas at 250 coordinates randomly. The time required to execute this application is recorded for different phone devices.
  • RMS (record management system): The RMS test is conducted using a MIDP application that creates a record store, adds records, retrieves sorted enumerated RecordStore objects, iterates through the records, and finally deletes a record store. The total time for this execution is recorded for phone devices from different manufacturers.
  • Thread-switching: JAppsMark tests the speed of the VM handling thread-switching.


JAppsMark score meaning: Milliseconds per execution; a lower score means better performance.

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
Comment
Login
Forgot your account info?
Add comment
Anonymous comments subject to approval. Register here for member benefits.
Have a JavaWorld account? Log in here. Register now for a free account.
Resources