BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-27-2009, 01:08 PM   #1 (permalink)
New Member
 
Join Date: Apr 2009
Model: 9000
PIN: N/A
Carrier: Rogers
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Why is the jvm so slow?

Please Login to Remove!

I recently bought a shiny BB BOLD 9000. Lamenting the lack of an ogg vorbis player, I decided to write my own.

After porting JORbis to the blackberry libraries, I discovered to my utter shock that it took 7 minutes to decode a 2:23 song.

Now, the CPU in there is pretty beefy -- 624 MHz ARM. It should be able to handle a simple Ogg Decode, even in Java. My desktop computer runs the same code in 3.5 seconds.

For comparison, I dug out my old windows mobile phone with a 415 MHz ARM. It was able to decode the same song in 13.5 seconds using an ffmpeg vorbis codec in native code.

So what's going on here? Can the JVM really be 30 TIMES slower than C?! Am I doing something wrong?

Thanks for your time.
Offline  
Old 04-27-2009, 02:08 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

As a general comment, native C is going to be much faster than interpreted Java - that is for certain. Tough to say if it's 30x or 10x or whatever, really depends on how the code was implemented.
Offline  
Old 04-27-2009, 03:56 PM   #3 (permalink)
a3p
New Member
 
Join Date: Apr 2009
Model: 9000
PIN: N/A
Carrier: o2
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

this indirecly answers my question how to code new codecs for the berry. Apparantly you can't since apps are restricted to java, right?
Offline  
Old 04-27-2009, 04:30 PM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

You might try posting the question on the Blackberry developers forum.
Offline  
Old 04-27-2009, 04:36 PM   #5 (permalink)
New Member
 
Join Date: Apr 2009
Model: 9000
PIN: N/A
Carrier: Rogers
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Dougsg38p View Post
You might try posting the question on the Blackberry developers forum.
I thought this was the blackberry development forum. Where can I find it?
Offline  
Old 04-27-2009, 09:43 PM   #6 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

Quote:
Originally Posted by arrenlex View Post
I thought this was the blackberry development forum. Where can I find it?
It is. No idea what he means.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 04-27-2009, 09:46 PM   #7 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

Quote:
Originally Posted by a3p View Post
this indirecly answers my question how to code new codecs for the berry. Apparantly you can't since apps are restricted to java, right?
Yes, mundane third party apps are limited to Java. If you are a company with enought weight, or have an attractive enough application, you might be able to negotiate some special agreement. But I wouldn't expect it to happen vary often.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 04-27-2009, 10:40 PM   #8 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

This is what I am talking about:

BlackBerry Support Community Forums - Java Development - BlackBerry Support Community Forums

This forum is monitored by RIM and has about 10x the traffic of the one you are in right now.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.