Rhomobile Performance Issues

208 views
Skip to first unread message

David

unread,
Oct 3, 2012, 6:39:48 AM10/3/12
to rhom...@googlegroups.com
In the documents given for Optimizing the performance of rhomobile app, i could something like this,
 
  • - Load only required libraries
  • - Do not load all ruby files at start: it will slow down application startup time. Load them by demand.
 
What do they actually mean and how to implement this??
 
Please let me know if anyone knows about this..
 
Thanks in advance,
David

Jon Tara

unread,
Oct 3, 2012, 11:51:07 AM10/3/12
to rhom...@googlegroups.com
Don't put a zillion Ruby require statements needlessly in your application.rb.

S Hamid

unread,
Oct 3, 2012, 12:13:22 PM10/3/12
to rhom...@googlegroups.com
can we unload them, knowing that we have loaded zillions of it in one controller and unload them in other controller since we are not using it?

Jon Tara

unread,
Oct 3, 2012, 2:21:17 PM10/3/12
to rhom...@googlegroups.com
There's no reason to unload them. Once loaded, they are part of the applications virtual memory, and the OS will manage this memory as needed.

As well, I think the original suggestion is overstated. I load a HUGE number of requires at start-up (I need XMPP4R, a bunch of stuff used by XMPP4R, openssl... to connect to an IM server at startup) and it's really doesn't add up to much. It's doing a lot less than you think. Each file has already been pre-compiled to Ruby bytecode at build time. There's no parsing of Ruby going on. It's a tiny blip.

If you are having performance issues, this is not the place to look. Any performance problems will almost always lie with jQuery Mobile.

David

unread,
Oct 4, 2012, 12:18:55 AM10/4/12
to rhom...@googlegroups.com
Thanks Jon,
 
However i have only one line " require 'rho/rhoapplication'"
and i have not used more ruby libraries for my app.
having minified versions of jQuery and jQueryMobile.......
 
But at the time of build for android, there are so many ruby files getting copied for the build and at last am getting an .apk of 2.5 MB.
 
Why is this happening?
 
Is it possible to reduce the file size. Such as if u can see, the same app in Phonegap, its just 300 KB. What makes the difference and how to get rid of this???
 
Please help me.... Thanks.

Jon Tara

unread,
Oct 4, 2012, 11:08:50 AM10/4/12
to rhom...@googlegroups.com
You can't compare PhoneGap and Rhodes. PhoneGap is just a small "shim" between the OS and a Webview. With PhoneGap, you do all your work in Javascript. Phonegap does little more than package a web browser inside a native app, and provide the web browser with a local file store that it can pull files from.

Rhodes has Ruby, an internal server, and (if you use them) various native views, native toolbar, native tabbar, etc. It has to load a pretty good chunk of the Ruby core library in order to do anything. And there are core Rhodes components that are written in Ruby.

I don't think it's possible to reduce this, and I'm completely unconcerned. A 2.5MB app is minimal these days, and way under the OTA download limit for any platform. MIne is about 4MB, and I consider that quite reasonable.

 I just worked on a client's app that is 30MB, and I think it's more typical of the kind of app that might also be done in PhoneGap. The reason it is 30MB is because it has a large amount of built-in offline data. (Mostly map tiles.)

If your app can be done in 300K with Phonegap, perhaps you just don't need Rhodes. If you are doing anything substantial, though, Phonegap, IMO, is going to make life miserable as you constantly work-around the limitations of the environment.

It's like comparing a Smart Car to an SUV. If you are happy with the Smart Car and it meets your needs, there's no sense trying to talk you into the SUV. You can park it anywhere, it sips gas, but there isn't any room for the inlaws, and it takes two trips to the grocery to get everything home.


Jon Tara

unread,
Oct 4, 2012, 11:10:55 AM10/4/12
to rhom...@googlegroups.com
I like to think that Rhodes is more of a reasonable compromise, though, like my Mini Cooper Clubman. ;)

David

unread,
Oct 8, 2012, 12:31:59 AM10/8/12
to rhom...@googlegroups.com

Well said Jon.. We too had an app for a client and tats abt 72 MB as it was loaded with initial DB. Thats fine.. But am not comparing with Phone gap as such.. Jus a concern thats it...
 
Thanks a lot..

CodeMonkey

unread,
Oct 9, 2012, 2:54:36 PM10/9/12
to rhom...@googlegroups.com
So, the single line
require 'rho/rhoapplication'
shows that you are optimizing the performance?

Jon Tara

unread,
Oct 9, 2012, 3:22:02 PM10/9/12
to rhom...@googlegroups.com
It's doing the least work a Rhodes application can do. I don't know how you can optimize performance more than that! ;)

Egghead

unread,
Oct 10, 2012, 12:31:55 AM10/10/12
to rhom...@googlegroups.com
You can also watch the webinar later today. Its about performance issues. HTH
Reply all
Reply to author
Forward
0 new messages