Hello everyone, This email is about Marcin Raczkowski''s project for Ruby Summer Of Code (http://rubysoc.org/projects): Project #12: ActiveRecord Identity Map You can find the current implementation in my Rails repo (identity_map branch): http://github.com/miloops/rails/commits/identity_map I was assigned as the mentor project and I''ve also invested time working on it, since I find its very important for all of us using Rails to have this implemented. Several days ago, and after lots of feedback, I sent a pull request to rails/master as José Valim suggested: http://github.com/rails/rails/pull/76 Some key features that were lately implemented: - A middleware that wraps each request into a new map, if it''s disabled then no middleware is loaded. - IM is enabled by default: to disable it use config.active_record.identity_map = false - IM is flushed on tests setup, this was added to ActiveSupport::TestCase, if you are using Rspec, you should try with: before(:each) do ActiveRecord::IdentityMap.clear end - A WeakHash implementation was included in ActiveSupport, if you are using jRuby Weakling library will be used as WeakHash. I''ve been using a script to test resources, which is the most important feature that IM will bring among objects consistency, although speed has increased in some cases is not the goal of IM. Results from the script are very promising: http://gist.github.com/636470 I would love to get more feedback, if you try it feel free to comment on the pull request, reply this email, or contact me by email or IM at miloops at gmail. Thanks! :D -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
On Wed, Oct 20, 2010 at 11:14:31AM -0300, Emilio Tagua wrote:> Hello everyone, > > This email is about Marcin Raczkowski''s project for Ruby Summer Of > Code (http://rubysoc.org/projects): Project #12: ActiveRecord Identity > Map > > You can find the current implementation in my Rails repo (identity_map > branch): http://github.com/miloops/rails/commits/identity_map > > I was assigned as the mentor project and I''ve also invested time > working on it, since I find its very important for all of us using > Rails to have this implemented. > > Several days ago, and after lots of feedback, I sent a pull request to > rails/master as José Valim suggested: > http://github.com/rails/rails/pull/76 > > Some key features that were lately implemented: > > - A middleware that wraps each request into a new map, if it''s > disabled then no middleware is loaded. > - IM is enabled by default: to disable it use > config.active_record.identity_map = false > - IM is flushed on tests setup, this was added to > ActiveSupport::TestCase, if you are using Rspec, you should try with: > > before(:each) do > ActiveRecord::IdentityMap.clear > end > > - A WeakHash implementation was included in ActiveSupport, if you are > using jRuby Weakling library will be used as WeakHash. > > I''ve been using a script to test resources, which is the most > important feature that IM will bring among objects consistency, > although speed has increased in some cases is not the goal of IM. > > Results from the script are very promising: > > http://gist.github.com/636470 > > I would love to get more feedback, if you try it feel free to comment > on the pull request, reply this email, or contact me by email or IM at > miloops at gmail.It concerns me that we''re modifying existing tests. Specifically this commit: 4db9dca55e3acc2c59f252eb83ecb83db5f4b81b http://github.com/miloops/rails/commit/4db9dca55e3acc2c59f252eb83ecb83db5f4b81b It modifies existing tests in this file: activerecord/test/cases/associations/belongs_to_associations_test.rb Why was this change made? I would hope we could integrate IdentityMap without modifying existing AR tests. -- Aaron Patterson http://tenderlovemaking.com/
On Wed, Oct 20, 2010 at 11:14:31AM -0300, Emilio Tagua wrote:> Hello everyone, > > This email is about Marcin Raczkowski''s project for Ruby Summer Of > Code (http://rubysoc.org/projects): Project #12: ActiveRecord Identity > Map > > You can find the current implementation in my Rails repo (identity_map > branch): http://github.com/miloops/rails/commits/identity_map > > I was assigned as the mentor project and I''ve also invested time > working on it, since I find its very important for all of us using > Rails to have this implemented. > > Several days ago, and after lots of feedback, I sent a pull request to > rails/master as José Valim suggested: > http://github.com/rails/rails/pull/76 > > Some key features that were lately implemented: > > - A middleware that wraps each request into a new map, if it''s > disabled then no middleware is loaded. > - IM is enabled by default: to disable it use > config.active_record.identity_map = false > - IM is flushed on tests setup, this was added to > ActiveSupport::TestCase, if you are using Rspec, you should try with: > > before(:each) do > ActiveRecord::IdentityMap.clear > end > > - A WeakHash implementation was included in ActiveSupport, if you are > using jRuby Weakling library will be used as WeakHash. > > I''ve been using a script to test resources, which is the most > important feature that IM will bring among objects consistency, > although speed has increased in some cases is not the goal of IM. > > Results from the script are very promising: > > http://gist.github.com/636470 > > I would love to get more feedback, if you try it feel free to comment > on the pull request, reply this email, or contact me by email or IM at > miloops at gmail.More questions about 4db9dca55e3acc2c59f252eb83ecb83db5f4b81b: http://github.com/miloops/rails/commit/4db9dca55e3acc2c59f252eb83ecb83db5f4b81b activerecord/test/cases/autosave_association_test.rb is changed. Why was this test changed? Does the AR api not work anymore? Is it changing? - assert !@pirate.ship.marked_for_destruction? + assert !@pirate.ship.target.reload.marked_for_destruction? Do I need to ask the new "target" object if it''s marked for destruction? I am worried. Changing existing tests does not instill confidence. :-( -- Aaron Patterson http://tenderlovemaking.com/
On Wed, Oct 20, 2010 at 2:58 PM, Aaron Patterson <aaron@tenderlovemaking.com> wrote:> On Wed, Oct 20, 2010 at 11:14:31AM -0300, Emilio Tagua wrote: >> Hello everyone, >> >> This email is about Marcin Raczkowski''s project for Ruby Summer Of >> Code (http://rubysoc.org/projects): Project #12: ActiveRecord Identity >> Map >> >> You can find the current implementation in my Rails repo (identity_map >> branch): http://github.com/miloops/rails/commits/identity_map >> >> I was assigned as the mentor project and I''ve also invested time >> working on it, since I find its very important for all of us using >> Rails to have this implemented. >> >> Several days ago, and after lots of feedback, I sent a pull request to >> rails/master as José Valim suggested: >> http://github.com/rails/rails/pull/76 >> >> Some key features that were lately implemented: >> >> - A middleware that wraps each request into a new map, if it''s >> disabled then no middleware is loaded. >> - IM is enabled by default: to disable it use >> config.active_record.identity_map = false >> - IM is flushed on tests setup, this was added to >> ActiveSupport::TestCase, if you are using Rspec, you should try with: >> >> before(:each) do >> ActiveRecord::IdentityMap.clear >> end >> >> - A WeakHash implementation was included in ActiveSupport, if you are >> using jRuby Weakling library will be used as WeakHash. >> >> I''ve been using a script to test resources, which is the most >> important feature that IM will bring among objects consistency, >> although speed has increased in some cases is not the goal of IM. >> >> Results from the script are very promising: >> >> http://gist.github.com/636470 >> >> I would love to get more feedback, if you try it feel free to comment >> on the pull request, reply this email, or contact me by email or IM at >> miloops at gmail. > > It concerns me that we''re modifying existing tests. Specifically this > commit: > > 4db9dca55e3acc2c59f252eb83ecb83db5f4b81b > > http://github.com/miloops/rails/commit/4db9dca55e3acc2c59f252eb83ecb83db5f4b81b > > It modifies existing tests in this file: > > activerecord/test/cases/associations/belongs_to_associations_test.rb > > Why was this change made? I would hope we could integrate IdentityMap > without modifying existing AR tests.Hey, I reverted that commit and fixed code to work as expected in those cases. I agree with you that existing tests shouldn''t change.> > -- > Aaron Patterson > http://tenderlovemaking.com/ >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
On Oct 20, 2010, at 4:14 PM, Emilio Tagua wrote:> Hello everyone, > > This email is about Marcin Raczkowski''s project for Ruby Summer Of > Code (http://rubysoc.org/projects): Project #12: ActiveRecord Identity > Map > > You can find the current implementation in my Rails repo (identity_map > branch): http://github.com/miloops/rails/commits/identity_map > > I was assigned as the mentor project and I''ve also invested time > working on it, since I find its very important for all of us using > Rails to have this implemented. > > Several days ago, and after lots of feedback, I sent a pull request to > rails/master as José Valim suggested: > http://github.com/rails/rails/pull/76 > > Some key features that were lately implemented: > > - A middleware that wraps each request into a new map, if it''s > disabled then no middleware is loaded. > - IM is enabled by default: to disable it use > config.active_record.identity_map = false > - IM is flushed on tests setup, this was added to > ActiveSupport::TestCase, if you are using Rspec, you should try with: > > before(:each) do > ActiveRecord::IdentityMap.clear > end > > - A WeakHash implementation was included in ActiveSupport, if you are > using jRuby Weakling library will be used as WeakHash. > > I''ve been using a script to test resources, which is the most > important feature that IM will bring among objects consistency, > although speed has increased in some cases is not the goal of IM. > > Results from the script are very promising: > > http://gist.github.com/636470 > > I would love to get more feedback, if you try it feel free to comment > on the pull request, reply this email, or contact me by email or IM at > miloops at gmail. > > Thanks! :DHi, I just wanted to say that I am really happy with all the work that has been put into this feature. Currently I''m working on one Rails 3 project for which an identity map is an enormous benefit. I''m using the identity_map branch of your fork, and it''s working very well for me. I was wondering if it is close to being merged into Rails? Is there anything I can do to help? Thanks to everyone for their hard work on this so far! Kind regards, Rolf Timmermans -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
On Mon, Nov 22, 2010 at 12:05 PM, Rolf Timmermans <r.timmermans@voormedia.com> wrote:> On Oct 20, 2010, at 4:14 PM, Emilio Tagua wrote: > >> Hello everyone, >> >> This email is about Marcin Raczkowski''s project for Ruby Summer Of >> Code (http://rubysoc.org/projects): Project #12: ActiveRecord Identity >> Map >> >> You can find the current implementation in my Rails repo (identity_map >> branch): http://github.com/miloops/rails/commits/identity_map >> >> I was assigned as the mentor project and I''ve also invested time >> working on it, since I find its very important for all of us using >> Rails to have this implemented. >> >> Several days ago, and after lots of feedback, I sent a pull request to >> rails/master as José Valim suggested: >> http://github.com/rails/rails/pull/76 >> >> Some key features that were lately implemented: >> >> - A middleware that wraps each request into a new map, if it''s >> disabled then no middleware is loaded. >> - IM is enabled by default: to disable it use >> config.active_record.identity_map = false >> - IM is flushed on tests setup, this was added to >> ActiveSupport::TestCase, if you are using Rspec, you should try with: >> >> before(:each) do >> ActiveRecord::IdentityMap.clear >> end >> >> - A WeakHash implementation was included in ActiveSupport, if you are >> using jRuby Weakling library will be used as WeakHash. >> >> I''ve been using a script to test resources, which is the most >> important feature that IM will bring among objects consistency, >> although speed has increased in some cases is not the goal of IM. >> >> Results from the script are very promising: >> >> http://gist.github.com/636470 >> >> I would love to get more feedback, if you try it feel free to comment >> on the pull request, reply this email, or contact me by email or IM at >> miloops at gmail. >> >> Thanks! :D > > Hi, > > I just wanted to say that I am really happy with all the work that has been put into this feature. Currently I''m working on one Rails 3 project for which an identity map is an enormous benefit. I''m using the identity_map branch of your fork, and it''s working very well for me. > > I was wondering if it is close to being merged into Rails? Is there anything I can do to help?Hey Rolf, That''s great! Just try to stay up to date with my repo, and if you run into any issue or you have any feedback or question write here or email me. Thanks! Emilio> > Thanks to everyone for their hard work on this so far! > > Kind regards, > > Rolf Timmermans > > > > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.