×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    10

    Thumbs up Poor Performance on Nokia phones & emulators

    Hi,
    I am actually developing an application (and not a game) and have found some drastic performance issues with the Nokia, both physical and emulator platforms: s40,s60,s80...they are all slow.

    If I create a MIDP 1.0 compatible app (ie I use Canvas and not GameCanvas) and use the following code during Canvas.draw():


    for (int i=0; i<loopCount; i++)
    {
    g.setColor(rand.nextInt());
    int x1 = (rand.nextInt()&0x7ffff) % rc.getWidth();
    int y1 = (rand.nextInt()&0x7ffff) % rc.getHeight();
    int x2 = (rand.nextInt()&0x7ffff) % rc.getWidth();
    int y2 = (rand.nextInt()&0x7ffff) % rc.getHeight();
    g.drawLine(x1, y1, x2, y2);
    }


    This loop can take anywhere from 10-60 secs to iterate 2000 times on the emulator.
    On ALL other emulators and physical devices the execution time is typcially less than 500ms (and generally around 50-100ms). On some hardware I see some very nice stats (<15ms).
    Why is Nokia so slow?

    Any ideas?

    I have tried using a GameCanvas and performing my own: dirty rect->update to backbauffer->update to main->flushGraphics. (using a timer). Performance is still bad.

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Poor Performance on Nokia phones & emulators

    Interesting.
    Out of curiosity. Have you checked if the rand.nextInt() or rc.getWidth/Height() method calls are slowing the loop down (replace with static values for example). Also you could comment the drawLine() method call.
    I would be interested to know the results, but right now I do not have time to check this out myself. If you do not have time, I'll try to squeeze this in my to-do list.

    Hartti

  3. #3
    Registered User
    Join Date
    Nov 2006
    Posts
    10

    Re: Poor Performance on Nokia phones & emulators

    hartti, thanks for your reply.

    In short, the getWidth/Height() calls are simply implemented as:
    rc.getWidth() { return right-left; }
    rc.getHeight() { return bottom-top; }
    (I should have removed them from the demo code, but are not the cause for the delay.)

    I use the Random to ensure that no caching of colors/line positions are used. In my (slow) application i do not use Random at all, and so I treat the randInt() call as having little impact.

    The Graphics object used is simply:
    Image img = Image.createImage(100,100);
    Graphics g = img.getGraphics();
    (getWidth() and getHeight() would also return 100)

    Upon further investigation, I was using the emulators provided with: nptsdk_jme_v4_0.zip.
    I have since downloaded and am using the s60 emulators provided with nS60_jme_sdk_3rd_e.zip to MUCH better response (15ms for the test).
    Nokia hardware still seems slower than other manufacturers tho (only by 1 order of magnitude) (eg 100ms vs 10ms).

    I would suggest that the 1st set of emulators (nptsdk_jme_v4_0.zip) get either fixed, or removed from the website.

  4. #4
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Poor Performance on Nokia phones & emulators

    Ok, so you were talking about the prototype SDKs. Those are provided for early access for future APIs and might not closely resemble the behavior of a real device (like you have seen).

    Thanks for the details!
    Hartti

  5. #5
    Registered User
    Join Date
    Nov 2006
    Posts
    10

    Re: Poor Performance on Nokia phones & emulators

    Should I be concerned that physical Nokia phones seem to be consistently 10x slower than other manufacturers (compared against Motorolla, SonyEricsson, Sharp)?

    Or is this something that everyone knows about?

    [edit]
    The comment above is aimed against speed tests against physical phones. Comparing emulator speeds is rather pointless.

    Yes, the emulator I was using is IMHO unusable. Using the latest s60 is much improved, as it performs much faster. This does not change the hardware performance issue tho.
    Last edited by cmroanirgo; 2007-01-04 at 23:44. Reason: unclear comment rectified

  6. #6
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Poor Performance on Nokia phones & emulators

    You say "consistently", so I am wondering which phones (both Nokia and other manufacturers) have you tested this on?

    I have not heard of such performance differences. There are a couple of Mobile Java benchmark tools, which can be used for proper benchmarking (if there ever is such thing as proper benchmarking):
    JBenchmark has some results here http://www.jbenchmark.com/result.jsp
    SPMarkJava06 http://www.futuremark.com/products/spmarkjava06/ is another tool, but I did not find any combined results pages

    Hartti

  7. #7
    Registered User
    Join Date
    Nov 2006
    Posts
    10

    Re: Poor Performance on Nokia phones & emulators

    Thanks hartti, I'll check these out.
    Of course I don't look busy! I got it right the first time.

Similar Threads

  1. Nokia, do you listen to your customers? Problems of your new phones
    By djprofessork in forum General Development Questions
    Replies: 3
    Last Post: 2007-09-24, 15:15
  2. Nokia 7650 support Bluetooth audo?
    By ovjo12 in forum Bluetooth Technology
    Replies: 5
    Last Post: 2003-07-17, 18:50
  3. Replies: 0
    Last Post: 2002-12-04, 15:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×