On Jan 29, 2013 12:49 AM, "Robin2" <robin...@gmail.com> wrote:
>
> Is this going in the direction of a special version of JRuby for use on Android?
No
>
> is that wise? Who will maintain it? (in addition to maintaining and developing Ruboto). What will happen in future if JRuby changes in a direction away from your solution so that it can no longer be converted?
>
> Will it be available for non-Ruboto use?
I think any differences would be in line with what we're already doing (i.e., programmatically reconfiguring jruby-jars to meet out needs).
>
> On a more positive note, would your changes also reduce the startup time for JRuby generally - so they could be incorporated into the standard JRuby code and maintained by the JRuby team?
I hope some changes would be accepted.
>
> Will the usual stream of improvements in Android devices (as with all PC stuff) speed things up sufficiently without any effort on your part? Presumably the delay is much less on an Android 4 tablet with lots of memory than on my 2.3.5 phone?
Yes, but I'm not sure it will be enough or happen fast enough. I believe it is worth making some efforts to: A) understand and B) fix the easiest stuff.
>
> I know the delay is irritating when I am constantly re-loading an app to test my program. But is it really a problem for end-users? If I start an app there is the expected delay but if I switch to another app and then back to my JRuby app it is still "alive" and there is no startup delay.
Not sure. I believe that we are outside of the acceptable range on many types of apps. Also, frustrating for developers means limited adoption.
>
> Design and test the app in Ruboto and then convert it to Mirah! (Since gems don't seem to work well with Ruboto the conversion should be easy). (ok, I'm gone)
>
Always an option, but does it have to be?
I should be clearer:
- I currently see a 9-12 second start up on IRB (on a 4.1, quad core, 1GB RAM device)
- A regular app will see additional start up time based on includes and requires needed for start up
- While start up time is not a huge issue for some apps, I'd like to be closer to 3-5 seconds for apps on modern hardware
Other opinions?
On my HTC phone "what Matz hath wrought" takes 28 seconds to appear so 9-12 is lightning fast.
On my simple JRuby on Android system my simple camera app takes 17 seconds to start. Is it possible there is dead wood within Ruboto?
On Tue, Jan 29, 2013 at 8:22 AM, Robin2 <robin...@gmail.com> wrote:On my HTC phone "what Matz hath wrought" takes 28 seconds to appear so 9-12 is lightning fast.Yes, so improving start up on newer hardware should get older hardware some significant improvement.
Anyway, is your simple app available to take a look at? .
On Feb 1, 2013 11:04 AM, "ssteidte" <admira...@gmail.com> wrote:
>
> One of the big advantages of Ruboto over other approaches like Rhodes, that precompile everything, is that the Ruby code does _not_ have to be precompiled.
Agreed! I'm only talking about compiling the internal scripts that are static to JRuby (jruby, kernal, etc.) or Ruboto (activity, widget etc.). These are (often) loaded at startup and are not edited by the developer. If we can load them fast, we can remove their impact on overall speed of the app.
Here's the current state of my findings...
I see two relatively easy wins:
1) Prevent rubygems from being loaded at start up.
2) Shift default utf codes from files into Java arrays.
Between these two, I think we can cut start up in half. I had thought that shifting files (stdlib, etc.) from the apk/jar to the file system would be a win, but I don't think it is worth it at this time. The reasons: a) can't yet shift most of the start up files to the file system, and b) there is a large hassle in copying files into the file system. This would be a win in reducing heap allocation, but that is not the problem I'm trying to solve a the moment.
More information on making 1 & 2 happen:
1) JRuby currently loads three things from .rb files at start up: jruby, kernel, and rubygems. Each of these accounts for 2-5 seconds at start up (because it means parsing and loading 5-10 files. Of the three, rubygems is the obvious one for deferring loading (i.e., making sure that it only gets loaded when needed...like normal ruby). It is fairly easy to turn off, but I need to do additional work to make sure it is available when needed. This does save 4-5 seconds at start up.
2) JCodings is the project that handles character encoding formats in JRuby. There are about 100 files that contain the codings. Of these, ~12 get loaded at start up when the RubyString class is initialized. The files are read into a Java structure. We can save 2-4 seconds by shifting this process directly into Java structures. The challenge here is that this will likely take changes to the JCoding project (i.e., we need others to buy in to this approach). JCoding comes into JRuby as a jar. We could strip out and replace a single class, but this is not a long-term solution.
Other improvements are possible, but I suggest that we get these into Ruboto before pursuing more.
Are your changes available anywhere for testing, Scott?
Whoa, how exactly did you profile and figure this out? It sounds like you pinpointed two pretty specific targets.Or is it an educated guess? :)