Re: [jruby-dev] Improving Ruby to Java call performance: no instance vars or singletons

2010-06-15 Thread Charles Oliver Nutter
Perhaps, though the opt-in wouldn't be per object, it would be per class. You'd essentially specify that you want to use instance vars or singletons with a given Java type. I will probably at least try to mock up the lazy ivar logic, which seems like it could work. The singleton logic...that's

RE: [jruby-dev] Improving Ruby to Java call performance: no instance vars or singletons

2010-06-14 Thread Brandon Hauff
Could the opt-in be in the form of a command line opt or a require 'somenewlib' which would likely be a lot easier to port and more clean than calling a method per object? -Original Message- From: Charles Oliver Nutter [mailto:head...@headius.com] Sent: Sunday, June 13, 2010 6:28 PM

Re: [jruby-dev] Improving Ruby to Java call performance: no instance vars or singletons

2010-06-13 Thread Charles Oliver Nutter
On Sat, Jun 12, 2010 at 3:53 PM, Ola Bini ola.b...@gmail.com wrote: I do see the need to make these kind of changes, based on their performance impact. But I still have reservations (maybe because I'm one of the people who write code that usually sets instance variables on Java objects, and

Re: [jruby-dev] Improving Ruby to Java call performance: no instance vars or singletons

2010-06-13 Thread Charles Oliver Nutter
On Sun, Jun 13, 2010 at 2:54 AM, Wayne Meissner wmeiss...@gmail.com wrote: Could the weak ref wiring be done lazily, so the overhead is only incurred when someone sets an ivar on a java object? e.g. when a java object enters jruby, it gets a new lightweight wrapper, but when someone does an

Re: [jruby-dev] Improving Ruby to Java call performance: no instance vars or singletons

2010-06-13 Thread Charles Oliver Nutter
On Sun, Jun 13, 2010 at 11:19 PM, Charles Oliver Nutter head...@headius.com wrote: On Sun, Jun 13, 2010 at 2:54 AM, Wayne Meissner wmeiss...@gmail.com wrote: Could the weak ref wiring be done lazily, so the overhead is only incurred when someone sets an ivar on a java object? e.g. when a java

[jruby-dev] Improving Ruby to Java call performance: no instance vars or singletons

2010-06-12 Thread Charles Oliver Nutter
One of the primary remaining perf challenges for JRuby is the cost of bringing Java objects into the Ruby environment. Currently, all objects get wrapped with a small wrapper object that implements IRubyObject. This is primarily because all our call logic requires receivers and arguments to all be

Re: [jruby-dev] Improving Ruby to Java call performance: no instance vars or singletons

2010-06-12 Thread Ola Bini
On 2010-06-12 10.41, Charles Oliver Nutter wrote: One of the primary remaining perf challenges for JRuby is the cost of bringing Java objects into the Ruby environment. Currently, all objects get wrapped with a small wrapper object that implements IRubyObject. This is primarily because all our

Re: [jruby-dev] Improving Ruby to Java call performance: no instance vars or singletons

2010-06-12 Thread Yoko Harada
On Sat, Jun 12, 2010 at 11:41 AM, Charles Oliver Nutter head...@headius.com wrote: One of the primary remaining perf challenges for JRuby is the cost of bringing Java objects into the Ruby environment. Currently, all objects get wrapped with a small wrapper object that implements IRubyObject.

Re: [jruby-dev] Improving Ruby to Java call performance: no instance vars or singletons

2010-06-12 Thread Wayne Meissner
Could the weak ref wiring be done lazily, so the overhead is only incurred when someone sets an ivar on a java object? e.g. when a java object enters jruby, it gets a new lightweight wrapper, but when someone does an ivar get/set on it, it looks for the ivar holder for the java object in the weak