Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Refactoring of attributes/typecasting behavior

#3348

Decouples the attribute/typecasting implementation, introducing an Attributes:Store and ActiveRecord::Types. I think this simplifies things and lays the groundwork for other improvements. Assuming this seems like a good idea, I'd like to continue by improving the Types implementation and seeing if it makes sense to extract any other attribute/typecasting behavior.

Reported by Eric Chapweske · October 8th, 2009 @ 07:25 AM

State: open
Milestone: 3.0.6
Assigned to: Pratik Pratik
Importance: none

Activity

  1. josh
    josh
    • Assigned user set to josh
    • State changed from new to open
    • Milestone cleared.

    October 15th, 2009 @ 01:28 AM

  2. josh
    josh
    • State changed from open to incomplete

    This is pretty awesome!

    But its not applying cleanly for me. Can you please rebase it.

    I would love to eventually pull this stuff back into ActiveModel.

    October 16th, 2009 @ 01:37 AM

  3. Eric Chapweske
    Eric Chapweske

    Woops, this new one should apply.

    October 17th, 2009 @ 01:55 AM

  4. Eric Chapweske
    Eric Chapweske

    Sorry, I created that last patch without the tests. This is the complete version.

    October 17th, 2009 @ 02:21 AM

  5. Repository
    Repository
    • State changed from incomplete to resolved

    October 17th, 2009 @ 06:37 PM

  6. Jeremy Kemper
    Jeremy Kemper
    • State changed from resolved to open

    This is a great refactoring but it's a huge performance regression: https://gist.github.com/3b5884a2c87755f4015d

    January 21st, 2010 @ 09:45 PM

  7. Repository
    Repository

    (from [6d30002a52133bd105adb29084f4cc72b1ee847f]) Revert "Refactoring attributes/types" [#3348 state:open]

    This reverts commit f936a1f100e75082081e782e5cceb272885c2df7.

    Conflicts:

    activerecord/lib/active_record.rb
    activerecord/lib/active_record/base.rb
    

    Revert "Fixed: #without_typecast should only disable typecasting on the duplicated attributes" [#3387 state:open]

    This reverts commit 2831996483c6a045f1f38d8030256eb58d9771c3.

    Reason :

    It's not generating attribute methods properly, making object.column 5x slower. http://github.com/rails/rails/commit/6d30002a52133bd105adb29084f4cc...

    January 21st, 2010 @ 09:52 PM

  8. josh
    josh
    • Assigned user changed from josh to Pratik

    January 22nd, 2010 @ 01:06 AM

  9. Eric Chapweske
    Eric Chapweske

    Hey guys,

    What's the performance goal for this?

    Current results: reading attributes is now 3x slower, though a couple methods are a fair bit faster. (query_attribute is 6x faster). The remaining performance differences are due to the longer method call path.

    I'd like to explore pulling the @attributes_cache into AR::Attributes and cache most methods by default, performance is then the same or better than 2.3.

    Cheers,
    -Eric

    January 25th, 2010 @ 05:20 PM

  10. Jeremy Kemper
    Jeremy Kemper

    Eric, the goal is 2.3 speed or better.

    January 25th, 2010 @ 05:43 PM

  11. Rohit Arondekar
    Rohit Arondekar

    Any updates to this ticket? Eric, have you had the chance to work on a new patch?

    June 17th, 2010 @ 07:36 AM

  12. Jeremy Kemper
    Jeremy Kemper
    • Milestone cleared.
    • Importance changed from to

    August 30th, 2010 @ 04:10 AM

  13. Jeremy Kemper
  14. Ryan Bigg
    Ryan Bigg
    • Tag cleared.

    Automatic cleanup of spam.

    October 19th, 2010 @ 08:33 AM

  15. Santiago Pastorino
  16. Santiago Pastorino
  17. Santiago Pastorino
    Santiago Pastorino
    • Milestone changed from 3.0.5 to 3.0.6

    February 27th, 2011 @ 03:15 AM