Charles Oliver Nutter created JRUBY-6506:
--------------------------------------------
Summary: Deprecate ObjectProxyCache
Key: JRUBY-6506
URL: https://jira.codehaus.org/browse/JRUBY-6506
Project: JRuby
Issue Type: Improvement
Components: Java Integration
Reporter: Charles Oliver Nutter
Assignee: Charles Oliver Nutter
Priority: Blocker
Fix For: JRuby 1.7
ObjectProxyCache is used to maintain mostly-live references to the wrappers
around Java objects, so that instance variables and singletons on them linger
across calls. This mostly works, but it incurs a massive performance hit for
all non-coercible Java objects entering Ruby due to the extra wrappers,
mapping, and weak references involved. In addition, it's not even 100%
reliable; objects that leave Ruby for long enough that GC runs may find their
wrappers have been culled anyway, leading to lazy, hard-to find bugs. OPC must
go.
Because this will be a breaking change for any libraries that depend on the
behavior, JRuby 1.7 will deprecate it and warn against its use in the future.
We will install for JRuby 1.7 (and enforce for JRuby 2.0) an opt-in policy
whereby specific classes can be flagged as "persistent". For persistent
classes, we will make a best effort to preserve the wrapper across calls...but
no more of an effort than we currently make. We will also attempt to lazily
make classes persistent if we see that they are being singletonized or have
ivars defined, but with an a warning indicating that we can't guarantee other
live references will see this new persistent wrapper.
JRuby 1.7 will warn once against the use of instance variables or singletons on
Java objects without first marking those classes as persistent. The warning
will link to a wiki page describing the issues and the deprecation of the
feature. We will also provide a flag/property users can set to switch JRuby
into the 2.0 mode, to allow testing their code against what will be live in 2.0.
When the 1.7 work has been completed, a new bug should be filed against 2.0 to
make the change permanent.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email