Most of stdlib seems to be .rb files that you include in your program with "require". Presumably they could all be included in a directory (in assets ?) if $LOAD_PATH is suitably set. Would that obviate the need for JRuby to make the index you mention? - and more importanty, reduce the demands on heap space? It looks like a lot of the other stuff in stdlib is unnecessary, for example the stuff in the bin directory.
I'm not sure I want to spend £200 on a new phone just to solve the heap problem.
An Android apk file is a jar file. The build process takes the files in the stdlib jar and unpacks them and then packs them into the new apk jar. The only way to get the stdlib files into the file system on the device is to have them in a separate archive inside the apk (and unpack them after install) or to do a separate pull (of the archive) from the net (and then unpack it).
I'm definitely not saying that I completely understand the internals of JRuby. I uncovered the indexing issue when I was examining the heap used on the WIMM One. I am still working out whether JRuby automatically indexes jars inside of jars or not. It seems like JRuby will create its index the first time it attempts to access a jar (to look for a file in it). Right now we set the path to include the stdlib within the apk, so it gets indexed even if it is never used.
I don't think that moving the stdlib out of the apk will be a big enough win in itself. It will impact the heap, though, and that might be enough to justify it. I do think there may be a start-up speed win by not loading start-up files from the jar (jruby, java, kernal, etc.). JRuby is still indexing things even if the stdlib is not included. It turns out that there are a decent number of rb files for jruby itself. There are also a substantial number of files for joda (timezone information for the date class) and jcoding (character mappings for various languages).
When I talk about the file system, I'm talking about the internal storage (in the /data/data/<package_name>/files) directory. We could store things in the sdcard, but that would not be very secure.
--
You received this message because you are subscribed to the Google Groups "Ruboto (JRuby on Android)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruboto+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
I'm definitely not saying that I completely understand the internals of JRuby. I uncovered the indexing issue when I rb