Peter K Chan wrote:
I have just gotten the AOT to run with my project, with minimal change, which
is impressive and very seamless. However, I did notice a few issues:
In general the compiler has developed entirely based on feedback and
ideas. So please, please, everyone that uses the compiler: share your
thoughts for making it better and more rubyish. And since the logic for
reading in the file(s) and dumping classfile(s) to disk is largely
contained in the jrubyc script + lib (all Ruby code) perhaps patches or
improvements could come with your ideas.
- When loading file name with dashes in it, the interpreter does not load the
proper escaped name (i.e. compiler produces rexml/encodings/UTF_minus_8 for
rexml/encodings/UTF-8, but interpreter still only loads
rexml/encodings/UTF-8). I will file a bug for this.
Ahh yes, I remember I wanted to fix this and never got around to it.
- The compiler default is to place everything under the “ruby” prefix, but the
interpreter does not “prefix” with ruby when loading (which makes sense, but
is not mentioned anywhere). The solution is to explicitly tell the compiler to
use empty prefix (-p “”).
I’m still on the fence about the compiler prefix. I added it to help
offset compiled .rb code from the normal Java package space, and to
avoid cases where the leading element of the Ruby dir might not be legal
as a root package (like if someone compiled java/foo/bar.rb).
For the most part this is a feature that was added in a vacuum, based
solely on a few technical challenges I ran into. If it seems too
cumbersome, I’m open to suggestions.
- It would be nice if the interpreter can automatically load “foo.class” when
asked to load “./foo.rb”.
If you’re referring to “load ‘./foo.rb’” in Ruby code, this is largely
correct load behavior. load requires you to specify exactly the filename
you want it to load. However, I can understand the desire to precompile
and still have load ‘xxx.rb’ continue to work. I’d like to make an
exception, but it would mean modifying load to have extension-swapping
logic. Worth it?
- My project uses a few big Ruby libraries (ActiveRecord, ActiveSupport, etc),
with 1500+ files. The launch time went from 3s to 11s. I am not sure why AOT
is so much slower than purely interpreted. This is a disappointment, as I was
hoping that the AOT compilation would speed ruby loading, but instead it
slowed down by four times.
There are two reasons for this:
- Classloading and verification appear to actually be slower than
parsing .rb source.
- We’ve done little work to investigate why compiled Ruby code loads
slower, so there certainly could be specific bottlenecks or logic that
could be made lazy.
I’d like to be able to say that precompiled code loads faster some day,
so perhaps file a bug for the slow load time. A few examples would be
helpful too, like maybe a benchmark that creates, compiles, and then
benchmarks loading 1000 files? And then different runs that vary size
To unsubscribe from this list, please visit: